Skip to content

Commit

Permalink
Backend type definition added into a header file (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
AryanSalmanpour authored Sep 24, 2021
1 parent ac1907f commit a76864c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ elseif("${BACKEND}" STREQUAL "OCL")
message("-- ${Green}${PROJECT_NAME} set to build with OpenCL backend${ColourReset}")
endif()

configure_file("${PROJECT_SOURCE_DIR}/include/rpp_backend.h.in" "${PROJECT_BINARY_DIR}/include/rpp_backend.h")

# Enable SIMD for HOST code (in both OpenCL and HIP backends)

if(NOT DEFINED SIMD_ENABLE)
Expand Down Expand Up @@ -168,7 +170,9 @@ add_subdirectory(addkernels)
# Installation

install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
install(DIRECTORY include DESTINATION ${CMAKE_INSTALL_PREFIX})
install(DIRECTORY include DESTINATION ${CMAKE_INSTALL_PREFIX} PATTERN "*.h.in" EXCLUDE)
install(FILES ${PROJECT_BINARY_DIR}/include/rpp_backend.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include)


# Set package information

Expand Down
7 changes: 7 additions & 0 deletions include/rpp_backend.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#ifndef GUARD_RPP_BACKEND_H_IN
#define GUARD_RPP_BACKEND_H_IN

#cmakedefine01 RPP_BACKEND_OPENCL
#cmakedefine01 RPP_BACKEND_HIP

#endif

0 comments on commit a76864c

Please sign in to comment.