ParRes / Kernels

This is a set of simple programs that can be used to explore the features of a parallel platform.
https://groups.google.com/forum/#!forum/parallel-research-kernels
Other
415 stars 109 forks source link

pic-sycl.cc uses C99 #601

Open jeffhammond opened 2 years ago

jeffhammond commented 2 years ago

This is probably wrong...

pic-sycl.cc:
"pic-sycl.cc", line 129: error: a type qualifier is not allowed
  void finish_distribution(const uint64_t n, particle_t p[const n])
                                                          ^

"pic-sycl.cc", line 129: error: a parameter is not allowed
  void finish_distribution(const uint64_t n, particle_t p[const n])
                                                                ^

"pic-sycl.cc", line 526: error: class "hipsycl::sycl::cpu_selector" has no member "select_device"
        d = sycl::cpu_selector{}.select_device();
                                 ^

"pic-sycl.cc", line 528: error: class "hipsycl::sycl::gpu_selector" has no member "select_device"
        d = sycl::gpu_selector{}.select_device();
                                 ^

"pic-sycl.cc", line 530: error: class "hipsycl::sycl::host_selector" has no member "select_device"
        d = sycl::host_selector{}.select_device();
                                  ^

"pic-sycl.cc", line 533: error: class "hipsycl::sycl::default_selector" has no member "select_device"
        d = sycl::default_selector{}.select_device();
                                     ^

6 errors detected in the compilation of "pic-sycl.cc".
keryell commented 2 years ago

In

  void finish_distribution(const uint64_t n, particle_t p[const n])

you could just use particle_t p[] or if you are courageous sycl::span from SYCL 2020.

d = sycl::default_selector{}.select_device();

is the old weird Java-like factory from SYCL 1.2 which has been removed. Now you can just use

d = sycl::device { sycl::default_selector_v };

or probably in the case of the default selector which select the default device, just:

d = {};

For more details: https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html#sec:device-selector