Some (not grave) mistakes in Spinors class (Defect #476)


Added by Alessandro Sciarra over 6 years ago.


Status:New Start date:14 May 2013
Priority:Low Due date:
Assignee:Christopher Pinke % Done:

0%

Category:-
Target version:-

Description

I would like to highlight the following aspects:
  • in the function
      size_t hardware::code::Spinors::get_read_write_size(const std::string& in) const
      

    we read at some point:
      if (in == "scalar_product_reduction") {
        //this kernel reads NUM_GROUPS complex numbers and writes 1 complex number
        //query work-sizes for kernel to get num_groups
        size_t ls2, gs2;
        cl_uint num_groups;
        this->get_work_sizes(scalar_product_reduction, &ls2, &gs2, &num_groups);
        return C * D * (num_groups + 1);
      }
      if (in == "global_squarenorm_reduction") {
        //this kernel reads NUM_GROUPS real numbers and writes 1 real number
        //query work-sizes for kernel to get num_groups
        size_t ls2, gs2;
        cl_uint num_groups;
        this->get_work_sizes(scalar_product_reduction, &ls2, &gs2, &num_groups);
        return D * (num_groups + 1);
      }
      

    but the kernels scalar_product_reduction is the wrong one to be asked for the work sizes. In my opinion, in the first get_work_sizes above, one should put scalar_product, while in the second global_squarenorm should be the correct kernel.
  • In the function
    void hardware::code::Spinors::set_complex_to_scalar_product_eoprec_device
    

    the scalar_product_reduction kernel is enqueued with the following line
    get_device()->enqueue_kernel(scalar_product_reduction, gs2, ls2);
    

    In my opinion, it should be better to enqueue it in this way
    get_device()->enqueue_kernel(scalar_product_reduction, 1, 1);
    

    as done in void hardware::code::Spinors::global_squarenorm_reduction.

Both the above mentioned aspect should be checked and, in case, corrected wherever even-odd preconditioning is used.


History

Also available in: Atom PDF