Skip to content

Commit

Permalink
cuda example
Browse files Browse the repository at this point in the history
  • Loading branch information
vorlac committed Jun 13, 2024
1 parent 3d4db87 commit 658ba35
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ include(godot-dev-configuration)
# 3rd party library setup/configuration (leverages vcpkg)
# =======================================================================

find_package(cuda REQUIRED)
find_package(fmt CONFIG REQUIRED)
find_package(spdlog CONFIG REQUIRED)

Expand Down Expand Up @@ -95,6 +96,7 @@ target_compile_options(${PROJECT_NAME} PUBLIC
/EHsc
/utf-8
/Zc:preprocessor

$<$<CONFIG:Debug>:
/MDd
>
Expand Down Expand Up @@ -125,13 +127,14 @@ target_compile_options(${PROJECT_NAME} PUBLIC
)

# enable extension hot swapping
target_compile_definitions(${PROJECT_NAME} PUBLIC
target_compile_definitions(${PROJECT_NAME} PUBLIC
HOT_RELOAD_ENABLED
)

# include directories gdextension library
target_include_directories(${PROJECT_NAME} PUBLIC
"${CMAKE_CURRENT_SOURCE_DIR}/src"
${CUDA_INCLUDE_DIRS}
)

if (NOT APPLE)
Expand Down
3 changes: 3 additions & 0 deletions src/main.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include "entity/level.hpp"
#include "ui/main_dialog.hpp"

#include <cuda/atomic>

namespace rl
{
class Main : public godot::Node
Expand All @@ -24,6 +26,7 @@ namespace rl

static void _bind_methods()
{
cuda::atomic<bool> test = true;
signal_binding<Main, event::signal_example>::add<double>();
}

Expand Down
17 changes: 9 additions & 8 deletions vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
"documentation": "https://github.com/microsoft/vcpkg/blob/master/docs/users/manifests.md",
"name": "roguelite",
"version": "0.1.0",
"dependencies": [
"fmt",
"spdlog"
]
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
"documentation": "https://github.com/microsoft/vcpkg/blob/master/docs/users/manifests.md",
"name": "roguelite",
"version": "0.1.0",
"dependencies": [
"fmt",
"spdlog",
"cuda"
]
}

0 comments on commit 658ba35

Please sign in to comment.