Skip to content

Add chipStar/SPIRV HIP backend and SYCL 2020 include fixes#809

Draft
pvelesko wants to merge 4 commits intolibocca:mainfrom
CHIP-SPV:chipstar-support
Draft

Add chipStar/SPIRV HIP backend and SYCL 2020 include fixes#809
pvelesko wants to merge 4 commits intolibocca:mainfrom
CHIP-SPV:chipstar-support

Conversation

@pvelesko
Copy link
Copy Markdown

Summary

  • cmake: Teach FindHIP.cmake to recognize HIP_PLATFORM=spirv (chipStar), finding libCHIP.so and defining __HIP_PLATFORM_SPIRV__ for host compilation
  • hip: Replace runtime arch-string heuristics in getDeviceArch and setArchCompilerFlags with compile-time __HIP_PLATFORM_AMD__ / __HIP_PLATFORM_NVIDIA__ / __HIP_PLATFORM_SPIRV__ branches
  • dpcpp: Update SYCL include path from legacy <CL/sycl.hpp> to SYCL 2020 <sycl/sycl.hpp> (required by oneAPI 2025+)
  • tests: Remove using int2/int3 aliases that collide with chipStar's HIP vector type definitions

Background

chipStar is an open-source HIP implementation that compiles kernels to architecture-agnostic SPIR-V IR, targeting Intel GPUs via Level-Zero/OpenCL. SPIR-V differs from AMD/NVIDIA HIP in two key ways relevant to OCCA:

  • No --offload-arch flag is needed (SPIR-V is ISA-agnostic; the GPU driver JIT-compiles at load time)
  • gcnArchName in hipDeviceProp_t returns "spirv64" rather than a GPU microarchitecture string

The chipStar-side fixes (implementing hipModuleLoad from file, populating gcnArchName, and suppressing unknown --offload-arch flags in hipcc) are tracked separately in the chipStar repo.

Test plan

  • All 13 HIP (chipStar) examples pass: ctest -j1 -R hip
  • Builds cleanly with HIP_PLATFORM=spirv against chipStar install
  • Verify AMD HIP build is unaffected (no SPIRV-specific ifdefs in non-CMake code paths)

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

Successfully merging this pull request may close these issues.

1 participant