Skip to content
Snippets Groups Projects
Commit bf50d3b2 authored by CHAMONT David's avatar CHAMONT David
Browse files

Reintroduce CMakeLists.txt in git versioning.

parent bea275d7
No related branches found
No related tags found
No related merge requests found
Pipeline #327284 failed
CMakeLists.txt
build
*.o[0-9]*
*.e[0-9]*
cmake_minimum_required (VERSION 3.4)
project(GrayScottSyclTuto CXX)
set(CMAKE_CXX_COMPILER icpx)
set(COMPILE_FLAGS "-fsycl -fsycl-targets=spir64 -Wall")
set(LINK_FLAGS "-fsycl -fsycl-targets=spir64")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
add_subdirectory (src)
set(SOURCE_FILE main.cpp)
set(TARGET_NAME main.exe)
add_executable(${TARGET_NAME} ${SOURCE_FILE})
set_target_properties(${TARGET_NAME} PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS}")
set_target_properties(${TARGET_NAME} PROPERTIES LINK_FLAGS "${LINK_FLAGS}")
cmake_minimum_required (VERSION 3.4)
project(GrayScottSyclTuto CXX)
set(CMAKE_CXX_COMPILER icpx)
set(COMPILE_FLAGS "-fsycl -fsycl-targets=spir64,nvptx64-nvidia-cuda -Wall")
set(LINK_FLAGS "-fsycl -fsycl-targets=spir64,nvptx64-nvidia-cuda")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
add_subdirectory (src)
set(SOURCE_FILE main.cpp)
set(TARGET_NAME main.exe)
add_executable(${TARGET_NAME} ${SOURCE_FILE})
set_target_properties(${TARGET_NAME} PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS}")
set_target_properties(${TARGET_NAME} PROPERTIES LINK_FLAGS "${LINK_FLAGS}")
......@@ -17,7 +17,9 @@ If you have an account on Code Reckons, you can simply copy/paste your code in t
Tip: so to see the output of your program, in your C++ source window, ask for "Add new... Execution Only".
Try to compile and run the content of `CheckOneApiCuda/src/main.cpp`. If you run it without any arguments, you will get a list of available devices with their *ranks*. If you provide a command-line rank, the program will try to run a test on the device with this rank. Because the default compilation options on Code Reckons only generate the code for CUDA, you will see that the program will not be able to run on the CPU.
Try to compile and run the content of `CheckOneApiCuda/src/main.cpp`. If you run it without any arguments, you will get a list of available devices with their *ranks*. If you provide a command-line rank, the program will try to run a test on the device with this rank.
Because the default compilation options on Code Reckons only generate the code for CUDA, you will see that the program will not be able to run on the CPU, unless you set the compilation option `-fsycl-targets=spir64`. If you want something which run both on CPU and CUDA, set `-fsycl-targets=spir64,nvptx64-nvidia-cuda`.
## Running on Intel DevCloud
......
cmake_minimum_required (VERSION 3.4)
project(DeviceList CXX)
set(CMAKE_CXX_COMPILER syclcc)
set(COMPILE_FLAGS "-O2 --opensycl-targets=cuda:sm_75")
set(LINK_FLAGS "-O2 --opensycl-targets=cuda:sm_75")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
add_subdirectory (src)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment