Commit 1677e0fb authored by jgp's avatar jgp
Browse files

fix

parent d138fd93
......@@ -19,6 +19,7 @@ if(HIP_FOUND)
check_language(HIP)
if(CMAKE_HIP_COMPILER)
enable_language(HIP)
set(CMAKE_HIP_FLAGS "-fPIC -fgpu-rdc -w")
endif()
else()
message(FATAL_ERROR "Could not find HIP. Ensure that HIP is either \
......
if(CMAKE_CUDA_COMPILER OR CMAKE_HIP_COMPILER)
add_library(test_obj OBJECT test.cu)
set_source_files_properties(test.cu util.cu PROPERTIES LANGUAGE HIP)
# target_include_directories(test_obj PRIVATE ${PROJECT_SOURCE_DIR}/include)
add_library(util_obj OBJECT util.cu)
add_library(test_obj OBJECT test.cu)
target_include_directories(test_obj PRIVATE ${PROJECT_SOURCE_DIR}/include)
endif()
......@@ -3,20 +3,13 @@
# target_include_directories(myexe PRIVATE ${PROJECT_SOURCE_DIR}/include)
# target_link_libraries(myexe PRIVATE OpenMP::OpenMP_CXX)
if(CMAKE_HIP_COMPILER)
# MESSAGE("YES")
# set(CMAKE_HIP_FLAGS "-fPIC -fgpu-rdc -w")
set_source_files_properties(main.cpp PROPERTIES LANGUAGE HIP)
add_executable(myexe-hip $<TARGET_OBJECTS:test_obj> $<TARGET_OBJECTS:util_obj> main.cpp)
set_property(TARGET myexe-hip PROPERTY HIP_ARCHITECTURES gfx908)
target_include_directories(myexe-hip PRIVATE ${PROJECT_SOURCE_DIR}/domain)
target_include_directories(myexe-hip PRIVATE ${PROJECT_SOURCE_DIR}/include)
target_include_directories(myexe-hip PRIVATE ${HIP_PATH}/include)
# target_compile_definitions(myexe-hip PRIVATE USE_MPI USE_CUDA)
# target_link_libraries(myLib hip::host)
# set_target_properties(myexe-hip PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
# target_link_libraries(myexe-hip PRIVATE OpenMP::OpenMP_CXX)
# target_link_libraries(myexe-hip PRIVATE CUDA::cudart)
# install(TARGETS myexe-hip RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
# if(CMAKE_CUDA_COMPILER)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment