Skip to content

Commit 30b08b7

Browse files
committed
hip(compile) - update include statements for HIP 7
- stddef.h is no longer supported - int types have been moved to the __hip_internal namespace
1 parent 42ebf75 commit 30b08b7

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

backends/hip/ceed-hip-compile.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,16 @@ static int CeedCompileCore_Hip(Ceed ceed, const char *source, const char *name,
120120
CeedCallHip(ceed, hipRuntimeGetVersion(&runtime_version));
121121
if (runtime_version < 40400000) {
122122
code << "#include <hip/hip_runtime.h>\n\n";
123-
}
124-
// With ROCm 4.5, need to include these definitions specifically for hiprtc (but cannot include the runtime header)
125-
else {
123+
} else if (runtime_version < 70000000) {
124+
// With ROCm 4.5, need to include these definitions specifically for hiprtc (but cannot include the runtime header)
126125
code << "#include <stddef.h>\n";
127126
code << "#define __forceinline__ inline __attribute__((always_inline))\n";
128127
code << "#define HIP_DYNAMIC_SHARED(type, var) extern __shared__ type var[];\n\n";
128+
} else {
129+
code << "using __hip_internal::int32_t;\n";
130+
code << "using __hip_internal::int64_t;\n";
131+
code << "#define __forceinline__ inline __attribute__((always_inline))\n";
132+
code << "#define HIP_DYNAMIC_SHARED(type, var) extern __shared__ type var[];\n\n";
129133
}
130134
}
131135

0 commit comments

Comments
 (0)