cpc / hipcl

OpenCL/SPIR-V implementation of HIP
Other
104 stars 12 forks source link

undefined reference to `__builtin_spirv_OpenCL_select_i32_i32_i1()' #24

Closed zjin-lcf closed 3 years ago

zjin-lcf commented 3 years ago

The reproducer is https://github.com/zjin-lcf/oneAPI-DirectProgramming/tree/master/quicksort-hip

franz commented 3 years ago

Can't reproduce, the test works for me:

$ ./quicksort  1 16 16
--------------------------------------------------------------------
Allocating array size of 256
Sorting the regular way...
Time to sort: 0.008231 ms
quicksort on the cpu: 
Time to sort: 0.008392 ms
verifying: true
Sorting with GPU quicksort: 
Time to sort: 3.09003 ms
verifying: true
 Number of failures: 0 out of 1
Average Time: 3.09003 ms
Average speedup over CPU quicksort: 0.00271583
Average speedup over CPU std::sort: 0.00266373
-------done--------------------------------------------------------

This is with Intel Skylake GPU:

  Platform Name                                   Intel(R) OpenCL HD Graphics
Number of devices                                 1
  Device Name                                     Intel(R) Graphics [0x1912]
  Device Vendor                                   Intel(R) Corporation
  Device Vendor ID                                0x8086
  Device Version                                  OpenCL 3.0 NEO 
  Driver Version                                  20.51.18762
  Device OpenCL C Version                         OpenCL C 3.0 

Which hardware do you use, is it CPU or GPU ? and which driver version ? It seems your driver has a problem with the generated SPIR-V.

zjin-lcf commented 3 years ago

It is a Gen8 GPU:

Platform Name Intel(R) OpenCL HD Graphics Number of devices 1 Device Name Intel(R) Graphics [0x162a] Device Vendor Intel(R) Corporation Device Vendor ID 0x8086 Device Version OpenCL 3.0 NEO Driver Version 20.51.18762 Device OpenCL C Version OpenCL C 3.0