From b40c3882077e9394bf4465dba48219a368c6f692 Mon Sep 17 00:00:00 2001 From: Paulius Velesko Date: Thu, 30 Apr 2026 02:15:41 +0300 Subject: [PATCH 1/2] cmake: add chipStar/SPIRV platform support to FindHIP --- cmake/FindHIP.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/FindHIP.cmake b/cmake/FindHIP.cmake index 99ad26c32..b80dc3a94 100644 --- a/cmake/FindHIP.cmake +++ b/cmake/FindHIP.cmake @@ -108,6 +108,10 @@ if(UNIX AND NOT APPLE AND NOT CYGWIN) set(HIP_RUNTIME_DEFINE "__HIP_PLATFORM_AMD__") set(HIP_PLATFORM "hip-clang") endif() + elseif(${HIP_PLATFORM} STREQUAL "spirv") + set(HIP_INCLUDE_DIRS "${HIP_ROOT_DIR}/include") + set(HIP_LIBRARIES "${HIP_ROOT_DIR}/lib/libCHIP.so") + set(HIP_RUNTIME_DEFINE "__HIP_PLATFORM_SPIRV__") elseif(${HIP_PLATFORM} STREQUAL "nvidia") find_package(CUDA) From 29cc3be71d95dba80b9e78262006b9d26d847d6c Mon Sep 17 00:00:00 2001 From: Paulius Velesko Date: Fri, 30 Oct 2026 01:56:57 +0200 Subject: [PATCH 2/2] hip: skip arch flag on SPIR-V (chipStar) SPIR-V is architecture-agnostic, so hipcc needs no arch flag. chipStar's gcnArchName is not a gfx/sm name, so the existing check errors. --- src/occa/internal/modes/hip/device.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/occa/internal/modes/hip/device.cpp b/src/occa/internal/modes/hip/device.cpp index 56678c6b7..b957cb394 100644 --- a/src/occa/internal/modes/hip/device.cpp +++ b/src/occa/internal/modes/hip/device.cpp @@ -211,6 +211,9 @@ namespace occa { } void device::setArchCompilerFlags(occa::json &kernelProps) { +#if defined(__HIP_PLATFORM_SPIRV__) + return; // SPIR-V is architecture-agnostic; no arch flag +#endif const std::string hipccCompilerFlags = ( kernelProps.get("hipcc_compiler_flags") );