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

parallelLoopPatterns fails on the Intel FPGA emulator SYCL backend #2450

Open
fwyzard opened this issue Jan 23, 2025 · 2 comments · May be fixed by #2456
Open

parallelLoopPatterns fails on the Intel FPGA emulator SYCL backend #2450

fwyzard opened this issue Jan 23, 2025 · 2 comments · May be fixed by #2456

Comments

@fwyzard
Copy link
Contributor

fwyzard commented Jan 23, 2025

The test tries to run kernels with 128 blocks and 64×2²⁰ (67108864) threads.

This results in 8×2³⁰ (8796093022208) threads, which causes at least two problems:

  • the compiler assumes that kernel-related queries (and possibly indices) fit in an int32_t variable, and so are limited to INT_MAX;
  • the examples use uint32_t indices, which overflow for values over 2³²-1.

The assumption of the compiler can be relaxed with the -fno-sycl-id-queries-fit-in-int flag, but I don't think we should do that by default in alpaka.

The examples could be fixed to use uint64_t (or plain int64_t) indices.

Or, the example could clamp the number of blocks or the number of threads per block so the product fits in INT_MAX.

@fwyzard
Copy link
Contributor Author

fwyzard commented Jan 23, 2025

Do alpaka device (or accelerators ?) have a "maximum number of threads per grid" ?

@fwyzard
Copy link
Contributor Author

fwyzard commented Jan 23, 2025

Note: it is possible to check in the code if -fno-sycl-id-queries-fit-in-int was used or not:

#if __SYCL_ID_QUERIES_FIT_IN_INT__
// assume that SYCL queries and maximum grid*block size fits in INT_MAX (2**31-1)
#else
// assume that 64-bit indices are supported, up to LONG_MAX (2**63-1)
#endif

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

Successfully merging a pull request may close this issue.

1 participant