ysh329 / OpenCL-101

Learn OpenCL step by step.
131 stars 29 forks source link

Preferred / native vector sizes? #19

Closed ysh329 closed 7 years ago

ysh329 commented 7 years ago

A good vector size is important.

$ clinfo | grep /                                                                         
  Preferred / native vector sizes                 
    char                                                16 / 16      
    short                                                8 / 8       
    int                                                  4 / 4       
    long                                                 2 / 2       
    half                                                 8 / 8        (cl_khr_fp16)
    float                                                4 / 4       
    double                                               2 / 2        (cl_khr_fp64)
ysh329 commented 7 years ago

It's necessary to optimize vector4 for float type and vector8 for half type .