From 0b83c3ad8506d2b04956e83e7ac9220abfc4a921 Mon Sep 17 00:00:00 2001 From: Fabio Pellacini Date: Tue, 1 Mar 2022 12:05:42 +0100 Subject: [PATCH] Fix build for Cutrace (#1340) --- CMakePresets.json | 56 ++++++++++++++++++++++++++++++++++--- libs/yocto/yocto_cutrace.cu | 24 ++++++---------- 2 files changed, 61 insertions(+), 19 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index e386f5c91..edb2d6a2c 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -16,7 +16,8 @@ "YOCTO_APPS": "ON", "YOCTO_EMBREE": "ON", "YOCTO_DENOISE": "ON", - "YOCTO_OPENGL": "ON" + "YOCTO_OPENGL": "ON", + "YOCTO_CUDA": "OFF" }, "architecture": { "value": "x64", @@ -33,7 +34,8 @@ "YOCTO_APPS": "ON", "YOCTO_EMBREE": "ON", "YOCTO_DENOISE": "ON", - "YOCTO_OPENGL": "ON" + "YOCTO_OPENGL": "ON", + "YOCTO_CUDA": "OFF" }, "architecture": { "value": "x64", @@ -50,7 +52,8 @@ "YOCTO_APPS": "ON", "YOCTO_EMBREE": "OFF", "YOCTO_DENOISE": "OFF", - "YOCTO_OPENGL": "ON" + "YOCTO_OPENGL": "ON", + "YOCTO_CUDA": "OFF" }, "architecture": { "value": "x64", @@ -67,7 +70,44 @@ "YOCTO_APPS": "ON", "YOCTO_EMBREE": "OFF", "YOCTO_DENOISE": "OFF", - "YOCTO_OPENGL": "ON" + "YOCTO_OPENGL": "ON", + "YOCTO_CUDA": "OFF" + }, + "architecture": { + "value": "x64", + "strategy": "external" + } + }, + { + "name": "release-cuda", + "description": "Release build", + "generator": "Ninja", + "binaryDir": "${sourceDir}/build/${presetName}", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "RelWithDebInfo", + "YOCTO_APPS": "ON", + "YOCTO_EMBREE": "OFF", + "YOCTO_DENOISE": "OFF", + "YOCTO_OPENGL": "ON", + "YOCTO_CUDA": "ON" + }, + "architecture": { + "value": "x64", + "strategy": "external" + } + }, + { + "name": "debug-cuda", + "description": "Debug build", + "generator": "Ninja", + "binaryDir": "${sourceDir}/build/${presetName}", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "YOCTO_APPS": "ON", + "YOCTO_EMBREE": "OFF", + "YOCTO_DENOISE": "OFF", + "YOCTO_OPENGL": "ON", + "YOCTO_CUDA": "ON" }, "architecture": { "value": "x64", @@ -91,6 +131,14 @@ { "name": "debug-nodep", "configurePreset": "debug-nodep" + }, + { + "name": "release-cuda", + "configurePreset": "release-cuda" + }, + { + "name": "debug-cuda", + "configurePreset": "debug-cuda" } ] } diff --git a/libs/yocto/yocto_cutrace.cu b/libs/yocto/yocto_cutrace.cu index 7a304b332..e0da43785 100644 --- a/libs/yocto/yocto_cutrace.cu +++ b/libs/yocto/yocto_cutrace.cu @@ -1,18 +1,12 @@ -// ======================================================================== // -// Copyright 2018-2019 Ingo Wald // -// // -// Licensed under the Apache License, Version 2.0 (the "License"); // -// you may not use this file except in compliance with the License. // -// You may obtain a copy of the License at // -// // -// http://www.apache.org/licenses/LICENSE-2.0 // -// // -// Unless required by applicable law or agreed to in writing, software // -// distributed under the License is distributed on an "AS IS" BASIS, // -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // -// See the License for the specific language governing permissions and // -// limitations under the License. // -// ======================================================================== // +// +// # Yocto/CuTrace: Path tracing on Cuda/Optix +// +// Yocto/CuTrace is a simple path tracer written on the Yocto/Scene model. +// Yocto/CuTrace is implemented in `yocto_cutrace.h`, `yocto_cutrace.cpp`, +// and `yocto_cutrace.cu`. +// +// THIS IS AN EXPERIMENTAL LIBRARY THAT IS NOT READY FOR PRIME TIME +// #include // do not flip it