Skip to content

Instantly share code, notes, and snippets.

@al42and
Last active September 6, 2022 12:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save al42and/2c21e842702f45b9be44d793a77a7d69 to your computer and use it in GitHub Desktop.
Save al42and/2c21e842702f45b9be44d793a77a7d69 to your computer and use it in GitHub Desktop.
project(HipSyclTest)
cmake_minimum_required(VERSION 3.0)
set(HIPSYCL_SYCLCC_EXTRA_ARGS -DCOMMON_DEFINE=1)
set(HIPSYCL_SYCLCC_EXTRA_ARGS_DEVICE_ONLY -DGPU_DEFINE=1 -ffast-math)
find_package(hipsycl REQUIRED)
add_executable(HipSyclTest main.cpp module_cpu.cpp module_gpu.cpp)
add_sycl_to_target(TARGET HipSyclTest SOURCES module_gpu.cpp)
int main() {}
#if !defined(__HIPSYCL__)
# error "__HIPSYCL__ macro not defined. Please check your hipSYCL installation."
#endif
#if defined(GPU_DEFINE)
# error "GPU_DEFINE set in a CPU file"
#endif
#if !defined(COMMON_DEFINE)
# error "COMMON_DEFINE not set in a CPU file"
#endif
#if !defined(__HIPSYCL__)
# error "__HIPSYCL__ macro not defined. Please check your hipSYCL installation."
#endif
#if !defined(GPU_DEFINE)
# error "GPU_DEFINE not set in a GPU file"
#endif
#if !defined(COMMON_DEFINE)
# error "COMMON_DEFINE not set in a GPU file"
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment