From cae5ddd4a2c9343ec7367c9049c5cc0c8628a9c4 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Wed, 8 Jan 2020 11:09:20 -0500 Subject: Setup of runtime cuda device (#1162) * CUDA generated first test compiles. * WIP on enabling CUDA in render-test. * Detect CUDA_PATH environmental variable to build build cuda support into render-test. Added WIP cuda-compute-util.cpp/h Added CUDA as a renderer type. * Fix libraries needed for cuda in premake. * Added -enable-cuda premake option. Defaults to false. * Creates CUDA device, loads PTX and finds entry point. * Fix some erroneous cruft from slang-cuda-prelude.h --- tools/gfx/render.cpp | 2 ++ tools/gfx/render.h | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'tools/gfx') diff --git a/tools/gfx/render.cpp b/tools/gfx/render.cpp index 785343927..43a255817 100644 --- a/tools/gfx/render.cpp +++ b/tools/gfx/render.cpp @@ -75,6 +75,7 @@ const Resource::DescBase& Resource::getDescBase() const BindingStyle::OpenGl, // OpenGl, BindingStyle::Vulkan, // Vulkan BindingStyle::CPU, // CPU + BindingStyle::CUDA, // CUDA }; /* static */void RendererUtil::compileTimeAsserts() @@ -405,6 +406,7 @@ ProjectionStyle RendererUtil::getProjectionStyle(RendererType type) case RendererType::Vulkan: return UnownedStringSlice::fromLiteral("Vulkan"); case RendererType::Unknown: return UnownedStringSlice::fromLiteral("Unknown"); case RendererType::CPU: return UnownedStringSlice::fromLiteral("CPU"); + case RendererType::CUDA: return UnownedStringSlice::fromLiteral("CUDA"); default: return UnownedStringSlice::fromLiteral("?!?"); } } diff --git a/tools/gfx/render.h b/tools/gfx/render.h index 65f3c00c0..a4d042a9a 100644 --- a/tools/gfx/render.h +++ b/tools/gfx/render.h @@ -68,13 +68,14 @@ enum class RendererType OpenGl, Vulkan, CPU, + CUDA, CountOf, }; enum class ProjectionStyle { Unknown, - OpenGl, + OpenGl, DirectX, Vulkan, CountOf, @@ -88,6 +89,7 @@ enum class BindingStyle OpenGl, Vulkan, CPU, + CUDA, CountOf, }; -- cgit v1.2.3