Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate nbody on ComputeCpp #36

Open
illuhad opened this issue Feb 21, 2020 · 2 comments
Open

Investigate nbody on ComputeCpp #36

illuhad opened this issue Feb 21, 2020 · 2 comments

Comments

@illuhad
Copy link
Collaborator

illuhad commented Feb 21, 2020

Reports indicate that there's an issue with nbody on ComputeCpp. But what could it be?

@oscarbg
Copy link

oscarbg commented Jun 7, 2020

I was going to open an issue with nbody sample not building on ComputeCpp SDK 2.0..
it's the bug the same as I'm seeing?
all errors are similar to:

sycl-bench/single-kernel/nbody.cpp:237:32: error: no viable overloaded '='
              my_particle(idx) = (idx.get_global_id(0) < problem_size) ? particles_access[idx.get_global_id(0)]
              ~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

full log:

[ 54%] Built target local_mem
[ 55%] Built target dag_task_throughput_independent_dag_task_throughput_independent.cpp_0_ih
[ 57%] Built target dag_task_throughput_independent
[ 58%] Building ComputeCpp integration header file /home/cosmic/tensor/sycl-bench/build/nbody_nbody.cpp.sycl
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:237:32: error: no viable overloaded '='
              my_particle(idx) = (idx.get_global_id(0) < problem_size) ? particles_access[idx.get_global_id(0)]
              ~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/media/cosmic/unix/2025/ComputeCpp-CE-2.0.0-x86_64-linux-gnu/include/SYCL/group.h:238:13: note: in instantiation of function template specialization 'cl::sycl::detail::kernelgen_parallel_for_work_item<1, (lambda at /home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:235:40)>' requested here
    detail::kernelgen_parallel_for_work_item<dimensions, workItemFunctionT>(
            ^
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:235:17: note: in instantiation of function template specialization 'cl::sycl::group<1>::parallel_for_work_item<(lambda at /home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:235:40)>' requested here
            grp.parallel_for_work_item([&](sycl::h_item<1> idx) {
                ^
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:327:11: note: in instantiation of member function 'NBody<float>::submitHierarchical' requested here
    this->submitHierarchical(this->particles_buf.get(), this->velocities_buf.get());
          ^
/home/cosmic/tensor/sycl-bench/include/common.h:83:13: note: in instantiation of member function 'NBodyHierarchical<float>::run' requested here
          b.run();
            ^
/home/cosmic/tensor/sycl-bench/include/common.h:214:11: note: in instantiation of function template specialization 'BenchmarkManager<NBodyHierarchical<float> >::run<>' requested here
      mgr.run(additional_args...);
          ^
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:344:7: note: in instantiation of function template specialization 'BenchmarkApp::run<NBodyHierarchical<float>>' requested here
  app.run< NBodyHierarchical<float> >();
      ^
/media/cosmic/unix/2025/ComputeCpp-CE-2.0.0-x86_64-linux-gnu/include/SYCL/vec_impl.h:9253:23: note: candidate function not viable: no known conversion from 'float __attribute__((ext_vector_type(4)))' (vector of 4 'float' values) to 'const vec<float, 4>' for 1st argument
  vec<dataT, kElems>& operator=(const vec<dataT, kElems>& rhs);
                      ^
/media/cosmic/unix/2025/ComputeCpp-CE-2.0.0-x86_64-linux-gnu/include/SYCL/vec_impl.h:9259:23: note: candidate function not viable: no known conversion from 'float __attribute__((ext_vector_type(4)))' (vector of 4 'float' values) to 'float' for 1st argument
  vec<dataT, kElems>& operator=(dataT rhs);
                      ^
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:244:46: error: no viable overloaded '='
                scratch[idx.get_local_id(0)] = (idx.get_global_id(0) < problem_size)
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/media/cosmic/unix/2025/ComputeCpp-CE-2.0.0-x86_64-linux-gnu/include/SYCL/group.h:238:13: note: in instantiation of function template specialization 'cl::sycl::detail::kernelgen_parallel_for_work_item<1, (lambda at /home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:243:42)>' requested here
    detail::kernelgen_parallel_for_work_item<dimensions, workItemFunctionT>(
            ^
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:243:19: note: in instantiation of function template specialization 'cl::sycl::group<1>::parallel_for_work_item<(lambda at /home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:243:42)>' requested here
              grp.parallel_for_work_item([&](sycl::h_item<1> idx) {
                  ^
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:327:11: note: in instantiation of member function 'NBody<float>::submitHierarchical' requested here
    this->submitHierarchical(this->particles_buf.get(), this->velocities_buf.get());
          ^
/home/cosmic/tensor/sycl-bench/include/common.h:83:13: note: in instantiation of member function 'NBodyHierarchical<float>::run' requested here
          b.run();
            ^
/home/cosmic/tensor/sycl-bench/include/common.h:214:11: note: in instantiation of function template specialization 'BenchmarkManager<NBodyHierarchical<float> >::run<>' requested here
      mgr.run(additional_args...);
          ^
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:344:7: note: in instantiation of function template specialization 'BenchmarkApp::run<NBodyHierarchical<float>>' requested here
  app.run< NBodyHierarchical<float> >();
      ^
/media/cosmic/unix/2025/ComputeCpp-CE-2.0.0-x86_64-linux-gnu/include/SYCL/vec_impl.h:9253:23: note: candidate function not viable: no known conversion from 'float __attribute__((ext_vector_type(4)))' (vector of 4 'float' values) to 'const vec<float, 4>' for 1st argument
  vec<dataT, kElems>& operator=(const vec<dataT, kElems>& rhs);
                      ^
/media/cosmic/unix/2025/ComputeCpp-CE-2.0.0-x86_64-linux-gnu/include/SYCL/vec_impl.h:9259:23: note: candidate function not viable: no known conversion from 'float __attribute__((ext_vector_type(4)))' (vector of 4 'float' values) to 'float' for 1st argument
  vec<dataT, kElems>& operator=(dataT rhs);
                      ^
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:237:32: error: no viable overloaded '='
              my_particle(idx) = (idx.get_global_id(0) < problem_size) ? particles_access[idx.get_global_id(0)]
              ~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/media/cosmic/unix/2025/ComputeCpp-CE-2.0.0-x86_64-linux-gnu/include/SYCL/apis.h:1568:13: note: in instantiation of function template specialization 'cl::sycl::detail::kernelgen_parallel_for_work_group<1, HierarchicalNBodyKernel<float>, (lambda at /home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:231:11)>' requested here
    detail::kernelgen_parallel_for_work_group<
            ^
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:229:11: note: in instantiation of function template specialization 'cl::sycl::handler::parallel_for_work_group<HierarchicalNBodyKernel<float>, (lambda at /home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:231:11), 1>' requested here
      cgh.parallel_for_work_group<HierarchicalNBodyKernel<float_type>>(sycl::range<1>{problem_size / local_size},
          ^
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:327:11: note: in instantiation of member function 'NBody<float>::submitHierarchical' requested here
    this->submitHierarchical(this->particles_buf.get(), this->velocities_buf.get());
          ^
/home/cosmic/tensor/sycl-bench/include/common.h:83:13: note: in instantiation of member function 'NBodyHierarchical<float>::run' requested here
          b.run();
            ^
/home/cosmic/tensor/sycl-bench/include/common.h:214:11: note: in instantiation of function template specialization 'BenchmarkManager<NBodyHierarchical<float> >::run<>' requested here
      mgr.run(additional_args...);
          ^
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:344:7: note: in instantiation of function template specialization 'BenchmarkApp::run<NBodyHierarchical<float>>' requested here
  app.run< NBodyHierarchical<float> >();
      ^
/media/cosmic/unix/2025/ComputeCpp-CE-2.0.0-x86_64-linux-gnu/include/SYCL/vec_impl.h:9253:23: note: candidate function not viable: no known conversion from 'float __attribute__((ext_vector_type(4)))' (vector of 4 'float' values) to 'const vec<float, 4>' for 1st argument
  vec<dataT, kElems>& operator=(const vec<dataT, kElems>& rhs);
                      ^
/media/cosmic/unix/2025/ComputeCpp-CE-2.0.0-x86_64-linux-gnu/include/SYCL/vec_impl.h:9259:23: note: candidate function not viable: no known conversion from 'float __attribute__((ext_vector_type(4)))' (vector of 4 'float' values) to 'float' for 1st argument
  vec<dataT, kElems>& operator=(dataT rhs);
                      ^
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:244:46: error: no viable overloaded '='
                scratch[idx.get_local_id(0)] = (idx.get_global_id(0) < problem_size)
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/media/cosmic/unix/2025/ComputeCpp-CE-2.0.0-x86_64-linux-gnu/include/SYCL/vec_impl.h:9253:23: note: candidate function not viable: no known conversion from 'float __attribute__((ext_vector_type(4)))' (vector of 4 'float' values) to 'const vec<float, 4>' for 1st argument
  vec<dataT, kElems>& operator=(const vec<dataT, kElems>& rhs);
                      ^
/media/cosmic/unix/2025/ComputeCpp-CE-2.0.0-x86_64-linux-gnu/include/SYCL/vec_impl.h:9259:23: note: candidate function not viable: no known conversion from 'float __attribute__((ext_vector_type(4)))' (vector of 4 'float' values) to 'float' for 1st argument
  vec<dataT, kElems>& operator=(dataT rhs);
                      ^
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:237:32: error: no viable overloaded '='
              my_particle(idx) = (idx.get_global_id(0) < problem_size) ? particles_access[idx.get_global_id(0)]
              ~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/media/cosmic/unix/2025/ComputeCpp-CE-2.0.0-x86_64-linux-gnu/include/SYCL/group.h:238:13: note: in instantiation of function template specialization 'cl::sycl::detail::kernelgen_parallel_for_work_item<1, (lambda at /home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:235:40)>' requested here
    detail::kernelgen_parallel_for_work_item<dimensions, workItemFunctionT>(
            ^
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:235:17: note: in instantiation of function template specialization 'cl::sycl::group<1>::parallel_for_work_item<(lambda at /home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:235:40)>' requested here
            grp.parallel_for_work_item([&](sycl::h_item<1> idx) {
                ^
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:327:11: note: in instantiation of member function 'NBody<double>::submitHierarchical' requested here
    this->submitHierarchical(this->particles_buf.get(), this->velocities_buf.get());
          ^
/home/cosmic/tensor/sycl-bench/include/common.h:83:13: note: in instantiation of member function 'NBodyHierarchical<double>::run' requested here
          b.run();
            ^
/home/cosmic/tensor/sycl-bench/include/common.h:214:11: note: in instantiation of function template specialization 'BenchmarkManager<NBodyHierarchical<double> >::run<>' requested here
      mgr.run(additional_args...);
          ^
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:345:7: note: in instantiation of function template specialization 'BenchmarkApp::run<NBodyHierarchical<double>>' requested here
  app.run< NBodyHierarchical<double> >();
      ^
/media/cosmic/unix/2025/ComputeCpp-CE-2.0.0-x86_64-linux-gnu/include/SYCL/vec_impl.h:9253:23: note: candidate function not viable: no known conversion from 'double __attribute__((ext_vector_type(4)))' (vector of 4 'double' values) to 'const vec<double, 4>' for 1st argument
  vec<dataT, kElems>& operator=(const vec<dataT, kElems>& rhs);
                      ^
/media/cosmic/unix/2025/ComputeCpp-CE-2.0.0-x86_64-linux-gnu/include/SYCL/vec_impl.h:9259:23: note: candidate function not viable: no known conversion from 'double __attribute__((ext_vector_type(4)))' (vector of 4 'double' values) to 'double' for 1st argument
  vec<dataT, kElems>& operator=(dataT rhs);
                      ^
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:244:46: error: no viable overloaded '='
                scratch[idx.get_local_id(0)] = (idx.get_global_id(0) < problem_size)
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/media/cosmic/unix/2025/ComputeCpp-CE-2.0.0-x86_64-linux-gnu/include/SYCL/group.h:238:13: note: in instantiation of function template specialization 'cl::sycl::detail::kernelgen_parallel_for_work_item<1, (lambda at /home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:243:42)>' requested here
    detail::kernelgen_parallel_for_work_item<dimensions, workItemFunctionT>(
            ^
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:243:19: note: in instantiation of function template specialization 'cl::sycl::group<1>::parallel_for_work_item<(lambda at /home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:243:42)>' requested here
              grp.parallel_for_work_item([&](sycl::h_item<1> idx) {
                  ^
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:327:11: note: in instantiation of member function 'NBody<double>::submitHierarchical' requested here
    this->submitHierarchical(this->particles_buf.get(), this->velocities_buf.get());
          ^
/home/cosmic/tensor/sycl-bench/include/common.h:83:13: note: in instantiation of member function 'NBodyHierarchical<double>::run' requested here
          b.run();
            ^
/home/cosmic/tensor/sycl-bench/include/common.h:214:11: note: in instantiation of function template specialization 'BenchmarkManager<NBodyHierarchical<double> >::run<>' requested here
      mgr.run(additional_args...);
          ^
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:345:7: note: in instantiation of function template specialization 'BenchmarkApp::run<NBodyHierarchical<double>>' requested here
  app.run< NBodyHierarchical<double> >();
      ^
/media/cosmic/unix/2025/ComputeCpp-CE-2.0.0-x86_64-linux-gnu/include/SYCL/vec_impl.h:9253:23: note: candidate function not viable: no known conversion from 'double __attribute__((ext_vector_type(4)))' (vector of 4 'double' values) to 'const vec<double, 4>' for 1st argument
  vec<dataT, kElems>& operator=(const vec<dataT, kElems>& rhs);
                      ^
/media/cosmic/unix/2025/ComputeCpp-CE-2.0.0-x86_64-linux-gnu/include/SYCL/vec_impl.h:9259:23: note: candidate function not viable: no known conversion from 'double __attribute__((ext_vector_type(4)))' (vector of 4 'double' values) to 'double' for 1st argument
  vec<dataT, kElems>& operator=(dataT rhs);
                      ^
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:237:32: error: no viable overloaded '='
              my_particle(idx) = (idx.get_global_id(0) < problem_size) ? particles_access[idx.get_global_id(0)]
              ~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/media/cosmic/unix/2025/ComputeCpp-CE-2.0.0-x86_64-linux-gnu/include/SYCL/apis.h:1568:13: note: in instantiation of function template specialization 'cl::sycl::detail::kernelgen_parallel_for_work_group<1, HierarchicalNBodyKernel<double>, (lambda at /home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:231:11)>' requested here
    detail::kernelgen_parallel_for_work_group<
            ^
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:229:11: note: in instantiation of function template specialization 'cl::sycl::handler::parallel_for_work_group<HierarchicalNBodyKernel<double>, (lambda at /home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:231:11), 1>' requested here
      cgh.parallel_for_work_group<HierarchicalNBodyKernel<float_type>>(sycl::range<1>{problem_size / local_size},
          ^
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:327:11: note: in instantiation of member function 'NBody<double>::submitHierarchical' requested here
    this->submitHierarchical(this->particles_buf.get(), this->velocities_buf.get());
          ^
/home/cosmic/tensor/sycl-bench/include/common.h:83:13: note: in instantiation of member function 'NBodyHierarchical<double>::run' requested here
          b.run();
            ^
/home/cosmic/tensor/sycl-bench/include/common.h:214:11: note: in instantiation of function template specialization 'BenchmarkManager<NBodyHierarchical<double> >::run<>' requested here
      mgr.run(additional_args...);
          ^
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:345:7: note: in instantiation of function template specialization 'BenchmarkApp::run<NBodyHierarchical<double>>' requested here
  app.run< NBodyHierarchical<double> >();
      ^
/media/cosmic/unix/2025/ComputeCpp-CE-2.0.0-x86_64-linux-gnu/include/SYCL/vec_impl.h:9253:23: note: candidate function not viable: no known conversion from 'double __attribute__((ext_vector_type(4)))' (vector of 4 'double' values) to 'const vec<double, 4>' for 1st argument
  vec<dataT, kElems>& operator=(const vec<dataT, kElems>& rhs);
                      ^
/media/cosmic/unix/2025/ComputeCpp-CE-2.0.0-x86_64-linux-gnu/include/SYCL/vec_impl.h:9259:23: note: candidate function not viable: no known conversion from 'double __attribute__((ext_vector_type(4)))' (vector of 4 'double' values) to 'double' for 1st argument
  vec<dataT, kElems>& operator=(dataT rhs);
                      ^
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:244:46: error: no viable overloaded '='
                scratch[idx.get_local_id(0)] = (idx.get_global_id(0) < problem_size)
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/media/cosmic/unix/2025/ComputeCpp-CE-2.0.0-x86_64-linux-gnu/include/SYCL/vec_impl.h:9253:23: note: candidate function not viable: no known conversion from 'double __attribute__((ext_vector_type(4)))' (vector of 4 'double' values) to 'const vec<double, 4>' for 1st argument
  vec<dataT, kElems>& operator=(const vec<dataT, kElems>& rhs);
                      ^
/media/cosmic/unix/2025/ComputeCpp-CE-2.0.0-x86_64-linux-gnu/include/SYCL/vec_impl.h:9259:23: note: candidate function not viable: no known conversion from 'double __attribute__((ext_vector_type(4)))' (vector of 4 'double' values) to 'double' for 1st argument
  vec<dataT, kElems>& operator=(dataT rhs);
                      ^
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:170:27: error: no viable conversion from 'float __attribute__((ext_vector_type(4)))' (vector of 4 'float' values) to 'NBody<float>::particle_type' (aka 'vec<float, 4>')
            particle_type my_particle = (global_id < num_particles) ? particles_access[global_id]
                          ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:159:11: note: in instantiation of exception specification for 'operator()' requested here
          [=, dt = this->dt, gravitational_softening = this->gravitational_softening](sycl::nd_item<1> tid) {
          ^
/media/cosmic/unix/2025/ComputeCpp-CE-2.0.0-x86_64-linux-gnu/include/SYCL/apis.h:1485:13: note: in instantiation of function template specialization 'cl::sycl::detail::kernelgen_parallel_for_nd<1, NDRangeNBodyKernel<float>, (lambda at /home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:159:11)>' requested here
    detail::kernelgen_parallel_for_nd<
            ^
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:158:11: note: in instantiation of function template specialization 'cl::sycl::handler::parallel_for<NDRangeNBodyKernel<float>, (lambda at /home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:159:11), 1>' requested here
      cgh.parallel_for<NDRangeNBodyKernel<float_type>>(execution_range,
          ^
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:303:11: note: in instantiation of member function 'NBody<float>::submitNDRange' requested here
    this->submitNDRange(this->particles_buf.get(), this->velocities_buf.get());
          ^
/home/cosmic/tensor/sycl-bench/include/common.h:83:13: note: in instantiation of member function 'NBodyNDRange<float>::run' requested here
          b.run();
            ^
/home/cosmic/tensor/sycl-bench/include/common.h:214:11: note: in instantiation of function template specialization 'BenchmarkManager<NBodyNDRange<float> >::run<>' requested here
      mgr.run(additional_args...);
          ^
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:348:9: note: in instantiation of function template specialization 'BenchmarkApp::run<NBodyNDRange<float>>' requested here
    app.run< NBodyNDRange<float> >();
        ^
/media/cosmic/unix/2025/ComputeCpp-CE-2.0.0-x86_64-linux-gnu/include/SYCL/vec_impl.h:9198:3: note: candidate constructor not viable: no known conversion from 'float __attribute__((ext_vector_type(4)))' (vector of 4 'float' values) to 'const vec<float, 4> &' for 1st argument
  vec(const vec<dataT, kElems>& rhs);
  ^
/media/cosmic/unix/2025/ComputeCpp-CE-2.0.0-x86_64-linux-gnu/include/SYCL/vec_impl.h:9183:3: note: candidate template ignored: could not match 'swizzled_vec<float, kElemsRhs, kIndexRhsN...>' against 'float __attribute__((ext_vector_type(4)))' (vector of 4 'float' values)
  vec(const swizzled_vec<dataT, kElemsRhs, kIndexRhsN...>& rhs);
  ^
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:174:33: error: no viable overloaded '='
              scratch[local_id] = (global_id < num_particles) ? particles_access[offset + local_id]
              ~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/media/cosmic/unix/2025/ComputeCpp-CE-2.0.0-x86_64-linux-gnu/include/SYCL/apis.h:1485:13: note: in instantiation of function template specialization 'cl::sycl::detail::kernelgen_parallel_for_nd<1, NDRangeNBodyKernel<float>, (lambda at /home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:159:11)>' requested here
    detail::kernelgen_parallel_for_nd<
            ^
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:158:11: note: in instantiation of function template specialization 'cl::sycl::handler::parallel_for<NDRangeNBodyKernel<float>, (lambda at /home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:159:11), 1>' requested here
      cgh.parallel_for<NDRangeNBodyKernel<float_type>>(execution_range,
          ^
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:303:11: note: in instantiation of member function 'NBody<float>::submitNDRange' requested here
    this->submitNDRange(this->particles_buf.get(), this->velocities_buf.get());
          ^
/home/cosmic/tensor/sycl-bench/include/common.h:83:13: note: in instantiation of member function 'NBodyNDRange<float>::run' requested here
          b.run();
            ^
/home/cosmic/tensor/sycl-bench/include/common.h:214:11: note: in instantiation of function template specialization 'BenchmarkManager<NBodyNDRange<float> >::run<>' requested here
      mgr.run(additional_args...);
          ^
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:348:9: note: in instantiation of function template specialization 'BenchmarkApp::run<NBodyNDRange<float>>' requested here
    app.run< NBodyNDRange<float> >();
        ^
/media/cosmic/unix/2025/ComputeCpp-CE-2.0.0-x86_64-linux-gnu/include/SYCL/vec_impl.h:9253:23: note: candidate function not viable: no known conversion from 'float __attribute__((ext_vector_type(4)))' (vector of 4 'float' values) to 'const vec<float, 4>' for 1st argument
  vec<dataT, kElems>& operator=(const vec<dataT, kElems>& rhs);
                      ^
/media/cosmic/unix/2025/ComputeCpp-CE-2.0.0-x86_64-linux-gnu/include/SYCL/vec_impl.h:9259:23: note: candidate function not viable: no known conversion from 'float __attribute__((ext_vector_type(4)))' (vector of 4 'float' values) to 'float' for 1st argument
  vec<dataT, kElems>& operator=(dataT rhs);
                      ^
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:170:27: error: no viable conversion from 'double __attribute__((ext_vector_type(4)))' (vector of 4 'double' values) to 'NBody<double>::particle_type' (aka 'vec<double, 4>')
            particle_type my_particle = (global_id < num_particles) ? particles_access[global_id]
                          ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:159:11: note: in instantiation of exception specification for 'operator()' requested here
          [=, dt = this->dt, gravitational_softening = this->gravitational_softening](sycl::nd_item<1> tid) {
          ^
/media/cosmic/unix/2025/ComputeCpp-CE-2.0.0-x86_64-linux-gnu/include/SYCL/apis.h:1485:13: note: in instantiation of function template specialization 'cl::sycl::detail::kernelgen_parallel_for_nd<1, NDRangeNBodyKernel<double>, (lambda at /home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:159:11)>' requested here
    detail::kernelgen_parallel_for_nd<
            ^
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:158:11: note: in instantiation of function template specialization 'cl::sycl::handler::parallel_for<NDRangeNBodyKernel<double>, (lambda at /home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:159:11), 1>' requested here
      cgh.parallel_for<NDRangeNBodyKernel<float_type>>(execution_range,
          ^
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:303:11: note: in instantiation of member function 'NBody<double>::submitNDRange' requested here
    this->submitNDRange(this->particles_buf.get(), this->velocities_buf.get());
          ^
/home/cosmic/tensor/sycl-bench/include/common.h:83:13: note: in instantiation of member function 'NBodyNDRange<double>::run' requested here
          b.run();
            ^
/home/cosmic/tensor/sycl-bench/include/common.h:214:11: note: in instantiation of function template specialization 'BenchmarkManager<NBodyNDRange<double> >::run<>' requested here
      mgr.run(additional_args...);
          ^
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:349:9: note: in instantiation of function template specialization 'BenchmarkApp::run<NBodyNDRange<double>>' requested here
    app.run< NBodyNDRange<double> >();
        ^
/media/cosmic/unix/2025/ComputeCpp-CE-2.0.0-x86_64-linux-gnu/include/SYCL/vec_impl.h:9198:3: note: candidate constructor not viable: no known conversion from 'double __attribute__((ext_vector_type(4)))' (vector of 4 'double' values) to 'const vec<double, 4> &' for 1st argument
  vec(const vec<dataT, kElems>& rhs);
  ^
/media/cosmic/unix/2025/ComputeCpp-CE-2.0.0-x86_64-linux-gnu/include/SYCL/vec_impl.h:9183:3: note: candidate template ignored: could not match 'swizzled_vec<double, kElemsRhs, kIndexRhsN...>' against 'double __attribute__((ext_vector_type(4)))' (vector of 4 'double' values)
  vec(const swizzled_vec<dataT, kElemsRhs, kIndexRhsN...>& rhs);
  ^
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:174:33: error: no viable overloaded '='
              scratch[local_id] = (global_id < num_particles) ? particles_access[offset + local_id]
              ~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/media/cosmic/unix/2025/ComputeCpp-CE-2.0.0-x86_64-linux-gnu/include/SYCL/apis.h:1485:13: note: in instantiation of function template specialization 'cl::sycl::detail::kernelgen_parallel_for_nd<1, NDRangeNBodyKernel<double>, (lambda at /home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:159:11)>' requested here
    detail::kernelgen_parallel_for_nd<
            ^
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:158:11: note: in instantiation of function template specialization 'cl::sycl::handler::parallel_for<NDRangeNBodyKernel<double>, (lambda at /home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:159:11), 1>' requested here
      cgh.parallel_for<NDRangeNBodyKernel<float_type>>(execution_range,
          ^
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:303:11: note: in instantiation of member function 'NBody<double>::submitNDRange' requested here
    this->submitNDRange(this->particles_buf.get(), this->velocities_buf.get());
          ^
/home/cosmic/tensor/sycl-bench/include/common.h:83:13: note: in instantiation of member function 'NBodyNDRange<double>::run' requested here
          b.run();
            ^
/home/cosmic/tensor/sycl-bench/include/common.h:214:11: note: in instantiation of function template specialization 'BenchmarkManager<NBodyNDRange<double> >::run<>' requested here
      mgr.run(additional_args...);
          ^
/home/cosmic/tensor/sycl-bench/single-kernel/nbody.cpp:349:9: note: in instantiation of function template specialization 'BenchmarkApp::run<NBodyNDRange<double>>' requested here
    app.run< NBodyNDRange<double> >();
        ^
/media/cosmic/unix/2025/ComputeCpp-CE-2.0.0-x86_64-linux-gnu/include/SYCL/vec_impl.h:9253:23: note: candidate function not viable: no known conversion from 'double __attribute__((ext_vector_type(4)))' (vector of 4 'double' values) to 'const vec<double, 4>' for 1st argument
  vec<dataT, kElems>& operator=(const vec<dataT, kElems>& rhs);
                      ^
/media/cosmic/unix/2025/ComputeCpp-CE-2.0.0-x86_64-linux-gnu/include/SYCL/vec_impl.h:9259:23: note: candidate function not viable: no known conversion from 'double __attribute__((ext_vector_type(4)))' (vector of 4 'double' values) to 'double' for 1st argument
  vec<dataT, kElems>& operator=(dataT rhs);
                      ^
12 errors generated.
make[2]: *** [CMakeFiles/nbody_nbody.cpp_0_ih.dir/build.make:80: nbody_nbody.cpp.bc] Error 1
make[1]: *** [CMakeFiles/Makefile2:1663: CMakeFiles/nbody_nbody.cpp_0_ih.dir/all] Error 2
make: *** [Makefile:147: all] Error 2

@illuhad
Copy link
Collaborator Author

illuhad commented Jun 8, 2020

If I recall correctly, I think the issue was more of a semantic nature. I think the code is correct as per the specification. I don't think we did any testing with ComputeCpp 2.0, so this might be a regression on their part. Can you try with ComputeCpp 1.3?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants