-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can build with no render #30
Conversation
I did not realize the paths were absolute. I will work on making them relative.
Thanks,
________________________________
From: Rod Burns ***@***.***>
Sent: 08 January 2024 10:54
To: codeplaysoftware/cuda-to-sycl-nbody ***@***.***>
Cc: Pablo ***@***.***>; Author ***@***.***>
Subject: Re: [codeplaysoftware/cuda-to-sycl-nbody] Can build with no render (PR #30)
@rodburns requested changes on this pull request.
________________________________
In .vscode/launch.json<#30 (comment)>:
+ "text": "set print frame-arguments none",
+ "ignoreFailures": true
+ }
+ ]
+ },
+ {
+ "comments": [
+ "Full launch.json configuration details can be found here:",
+ "https://code.visualstudio.com/docs/cpp/launch-json-reference"
+ ],
+ "name": "DEBUG: (cuda-gdb) nbody_cuda_d Launch",
+ "type": "cuda-gdb",
+ "request": "launch",
+ "preLaunchTask": "Debug C/C++: CUDA Makefile",
+ "postDebugTask": "",
+ "program": "/home/pablo/src/n-body/cuda-to-sycl-nbody/nbody_cuda_d",
Should this reference a specific path on a machine? Is there a way to make this generic?
________________________________
In .vscode/launch.json<#30 (comment)>:
@@ -0,0 +1,64 @@
+{
+ "configurations": [
+ {
+ "comments": [
+ "Full launch.json configuration details can be found here:",
+ "https://code.visualstudio.com/docs/cpp/launch-json-reference"
+ ],
+ "name": "DEBUG: (gdb-oneapi) nbody_dpcpp_d Launch",
+ "type": "cppdbg",
+ "request": "launch",
+ "preLaunchTask": "Debug C/C++: DPCPP Makefile",
+ "postDebugTask": "",
+ "program": "/home/pablo/src/n-body/cuda-to-sycl-nbody/nbody_dpcpp_d",
hould this reference a specific path on a machine? Is there a way to make this generic?
________________________________
In .vscode/tasks.json<#30 (comment)>:
+ "tasks": [
+ {
+ "type": "cppbuild",
+ "label": "Debug C/C++: CUDA Makefile",
+ "command": "make",
+ "args": [
+ "debug",
+ ],
+ "options": {
+ "cwd": "${workspaceFolder}/build_cuda"
+ },
+ "problemMatcher": [
+ "$gcc"
+ ],
+ "group": "build",
+ "detail": "compiler: /opt/slurm/intel/oneapi/2024.0.0.49397/compiler/2024.0/bin/icpx"
Will this need to be updated for each new oneAPI release? Is this a file that can be generated by VSCode itself?
________________________________
In .vscode/tasks.json<#30 (comment)>:
+ },
+ {
+ "type": "cppbuild",
+ "label": "Release C/C++: CUDA Makefile",
+ "command": "make",
+ "args": [
+ "release"
+ ],
+ "options": {
+ "cwd": "${workspaceFolder}/build_cuda"
+ },
+ "problemMatcher": [
+ "$gcc"
+ ],
+ "group": "build",
+ "detail": "compiler: /opt/slurm/intel/oneapi/2024.0.0.49397/compiler/2024.0/bin/icpx"
Will this need to be updated for each new oneAPI release? Is this a file that can be generated by VSCode itself?
—
Reply to this email directly, view it on GitHub<#30 (review)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BE6TABLPCL24W7TS55W7DMTYNPGADAVCNFSM6AAAAABBFXVMH6VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTQMBYG43DCOJQGQ>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
…ug compilation in sycl
I just pushed some changes to the repo:
The detail field in the task.json file is purely informative, and I couldn't find a way to insert the full compiler path into it. I've left it as "compiler: INTEL oneapi icpx". The program field in the launch.json file is now set via the ${workspaceFolder} variable.
I have also added default arguments for execution in the launch.json and addressed an issue with debug compilation in the src_sycl CMakeLists.txt file.
________________________________
From: Pablo ***@***.***>
Sent: 08 January 2024 11:01
To: codeplaysoftware/cuda-to-sycl-nbody ***@***.***>; codeplaysoftware/cuda-to-sycl-nbody ***@***.***>
Cc: Author ***@***.***>
Subject: Re: [codeplaysoftware/cuda-to-sycl-nbody] Can build with no render (PR #30)
I did not realize the paths were absolute. I will work on making them relative.
Thanks,
________________________________
From: Rod Burns ***@***.***>
Sent: 08 January 2024 10:54
To: codeplaysoftware/cuda-to-sycl-nbody ***@***.***>
Cc: Pablo ***@***.***>; Author ***@***.***>
Subject: Re: [codeplaysoftware/cuda-to-sycl-nbody] Can build with no render (PR #30)
@rodburns requested changes on this pull request.
________________________________
In .vscode/launch.json<#30 (comment)>:
+ "text": "set print frame-arguments none",
+ "ignoreFailures": true
+ }
+ ]
+ },
+ {
+ "comments": [
+ "Full launch.json configuration details can be found here:",
+ "https://code.visualstudio.com/docs/cpp/launch-json-reference"
+ ],
+ "name": "DEBUG: (cuda-gdb) nbody_cuda_d Launch",
+ "type": "cuda-gdb",
+ "request": "launch",
+ "preLaunchTask": "Debug C/C++: CUDA Makefile",
+ "postDebugTask": "",
+ "program": "/home/pablo/src/n-body/cuda-to-sycl-nbody/nbody_cuda_d",
Should this reference a specific path on a machine? Is there a way to make this generic?
________________________________
In .vscode/launch.json<#30 (comment)>:
@@ -0,0 +1,64 @@
+{
+ "configurations": [
+ {
+ "comments": [
+ "Full launch.json configuration details can be found here:",
+ "https://code.visualstudio.com/docs/cpp/launch-json-reference"
+ ],
+ "name": "DEBUG: (gdb-oneapi) nbody_dpcpp_d Launch",
+ "type": "cppdbg",
+ "request": "launch",
+ "preLaunchTask": "Debug C/C++: DPCPP Makefile",
+ "postDebugTask": "",
+ "program": "/home/pablo/src/n-body/cuda-to-sycl-nbody/nbody_dpcpp_d",
hould this reference a specific path on a machine? Is there a way to make this generic?
________________________________
In .vscode/tasks.json<#30 (comment)>:
+ "tasks": [
+ {
+ "type": "cppbuild",
+ "label": "Debug C/C++: CUDA Makefile",
+ "command": "make",
+ "args": [
+ "debug",
+ ],
+ "options": {
+ "cwd": "${workspaceFolder}/build_cuda"
+ },
+ "problemMatcher": [
+ "$gcc"
+ ],
+ "group": "build",
+ "detail": "compiler: /opt/slurm/intel/oneapi/2024.0.0.49397/compiler/2024.0/bin/icpx"
Will this need to be updated for each new oneAPI release? Is this a file that can be generated by VSCode itself?
________________________________
In .vscode/tasks.json<#30 (comment)>:
+ },
+ {
+ "type": "cppbuild",
+ "label": "Release C/C++: CUDA Makefile",
+ "command": "make",
+ "args": [
+ "release"
+ ],
+ "options": {
+ "cwd": "${workspaceFolder}/build_cuda"
+ },
+ "problemMatcher": [
+ "$gcc"
+ ],
+ "group": "build",
+ "detail": "compiler: /opt/slurm/intel/oneapi/2024.0.0.49397/compiler/2024.0/bin/icpx"
Will this need to be updated for each new oneAPI release? Is this a file that can be generated by VSCode itself?
—
Reply to this email directly, view it on GitHub<#30 (review)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BE6TABLPCL24W7TS55W7DMTYNPGADAVCNFSM6AAAAABBFXVMH6VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTQMBYG43DCOJQGQ>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it fixes #28 , thank you very much! Just a couple of small comments.
Hi,
The CMake build configuration ignores the '--config Debug' option, and instead, you can use the '--target debug' or '--target release' options, similar to the 'make' command. Here's how it works:
The 'build_cuda' script executes the CMake build, initially generating the 'nbody_cuda' release binary.
If you cd to the 'build_cuda' directory:
- Running cmake --build . --target debug' generates 'nbody_cuda_d'.
- Running cmake --build . --target release' creates 'nbody_cuda'.
- Using 'make debug' generates 'nbody_cuda_d'.
- Using 'make release' creates 'nbody_cuda'.
Entering 'cmake --build . --config Debug' builds both binaries (equivalent to 'cmake --build .', which builds '--target all').
The idea is to use the included vscode configuration files for building using make. I'm considering creating new config files that work with CMake as I become more familiar with it. However, this would be for new projects unless you believe it's necessary for the current nbody project.
________________________________
From: Duncan McBain ***@***.***>
Sent: 09 January 2024 19:31
To: codeplaysoftware/cuda-to-sycl-nbody ***@***.***>
Cc: Pablo ***@***.***>; Author ***@***.***>
Subject: Re: [codeplaysoftware/cuda-to-sycl-nbody] Can build with no render (PR #30)
@DuncanMcBain approved this pull request.
This looks like it fixes #28<#28> , thank you very much! Just a couple of small comments.
________________________________
In src/CMakeLists.txt<#30 (comment)>:
@@ -3,11 +3,13 @@
find_package(PkgConfig REQUIRED)
-pkg_check_modules(Glew REQUIRED IMPORTED_TARGET glew)
+if (RENDER)
+ pkg_check_modules(Glew REQUIRED IMPORTED_TARGET glew)
It looks like these are tabs, it would be great if we could stick to spaces all through the files if possible (most of our code sticks to two spaces indent for CMake and C++, like LLVM).
________________________________
In src/CMakeLists.txt<#30 (comment)>:
+add_custom_target(debug DEPENDS ${BINARY_NAME}_d)
+add_executable(${BINARY_NAME}_d ${SOURCE_FILES})
+# COMPILER_NAME here is only used to print text overlay on simulation
+target_compile_definitions(${BINARY_NAME}_d PRIVATE ${RENDER_FLAG} COMPILER_NAME="CUDA")
+target_link_libraries(${BINARY_NAME}_d PRIVATE ${RENDER_LIB})
+target_compile_features(${BINARY_NAME}_d PRIVATE cxx_auto_type cxx_nullptr cxx_range_for)
+target_include_directories(${BINARY_NAME}_d PRIVATE ${CUDA_INCLUDE_DIRS})
+target_compile_options(${BINARY_NAME}_d PRIVATE ${DEBUG_FLAGS})
For this section here I would normally expect to be able to use the CMake build configurations Release, RelWithDebInfo and Debug (documented here https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html). For example, if I set the CMake build type to Debug, will I have two debug executables here?
—
Reply to this email directly, view it on GitHub<#30 (review)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BE6TABLQNX47XAZCS6CLT7TYNWLKPAVCNFSM6AAAAABBFXVMH6VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTQMJRHAZTSMRQGM>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, we can merge this for now, but in future I think it would be valuable if it can be built using the standard CMAKE_BUILD_TYPE mechanism, as this will let it work with the rest of our projects (e.g. if we decide to make a benchmark suite, it would be useful to have this).
To build without openGL use:
sh scripts/build_cuda no_render
or
sh scripts/build_dpcpp no_render
The executables should be able to run on systems without OpenGL. In both cases, both release and debug targets can be built, with release being the default.
Additionally, the .vscode/targets.json and .vscode/launch.json files are included as examples of how to run a debug session from VSCode after CMake has been run.