From 5605faeed7bc2311ff03083b797e1574559a5869 Mon Sep 17 00:00:00 2001 From: Seth Troisi Date: Fri, 11 Mar 2022 14:08:42 -0800 Subject: [PATCH 1/3] Converted AtomicString to constexpr char[] --- Source/EmberCL/EmberCLFunctions.h | 48 ++++++++++------------ Source/EmberCL/IterOpenCLKernelCreator.cpp | 2 +- 2 files changed, 23 insertions(+), 27 deletions(-) diff --git a/Source/EmberCL/EmberCLFunctions.h b/Source/EmberCL/EmberCLFunctions.h index a5f0d0f..e902ff9 100644 --- a/Source/EmberCL/EmberCLFunctions.h +++ b/Source/EmberCL/EmberCLFunctions.h @@ -249,30 +249,26 @@ static constexpr char CarToRasFunctionString[] = "}\n" "\n"; -static string AtomicString() -{ - ostringstream os; - os << - "void AtomicAdd(volatile __global real_bucket_t* source, const real_bucket_t operand)\n" - "{\n" - " union\n" - " {\n" - " atomi intVal;\n" - " real_bucket_t realVal;\n" - " } newVal;\n" - "\n" - " union\n" - " {\n" - " atomi intVal;\n" - " real_bucket_t realVal;\n" - " } prevVal;\n" - "\n" - " do\n" - " {\n" - " prevVal.realVal = *source;\n" - " newVal.realVal = prevVal.realVal + operand;\n" - " } while (atomic_cmpxchg((volatile __global atomi*)source, prevVal.intVal, newVal.intVal) != prevVal.intVal);\n" - "}\n"; - return os.str(); -} +static constexpr char AtomicString[] = + "void AtomicAdd(volatile __global real_bucket_t* source, const real_bucket_t operand)\n" + "{\n" + " union\n" + " {\n" + " atomi intVal;\n" + " real_bucket_t realVal;\n" + " } newVal;\n" + "\n" + " union\n" + " {\n" + " atomi intVal;\n" + " real_bucket_t realVal;\n" + " } prevVal;\n" + "\n" + " do\n" + " {\n" + " prevVal.realVal = *source;\n" + " newVal.realVal = prevVal.realVal + operand;\n" + " } while (atomic_cmpxchg((volatile __global atomi*)source, prevVal.intVal, newVal.intVal) != prevVal.intVal);\n" + "}\n"; + } diff --git a/Source/EmberCL/IterOpenCLKernelCreator.cpp b/Source/EmberCL/IterOpenCLKernelCreator.cpp index 1428c06..5bb7db1 100755 --- a/Source/EmberCL/IterOpenCLKernelCreator.cpp +++ b/Source/EmberCL/IterOpenCLKernelCreator.cpp @@ -334,7 +334,7 @@ string IterOpenCLKernelCreator::CreateIterKernelString(const Ember& ember, CarToRasFunctionString; if (lockAccum) - os << AtomicString(); + os << AtomicString; os << xformFuncs.str() << From c841f1f5b773a67cc9777d2edaa1d341ef2ac634 Mon Sep 17 00:00:00 2001 From: Matt Feemster Date: Mon, 14 Mar 2022 04:49:13 +0000 Subject: [PATCH 2/3] BuildGuideQtCreator.md edited online with Bitbucket --- Data/BuildGuideQtCreator.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Data/BuildGuideQtCreator.md b/Data/BuildGuideQtCreator.md index 0ecfac5..fe5febf 100644 --- a/Data/BuildGuideQtCreator.md +++ b/Data/BuildGuideQtCreator.md @@ -1,15 +1,15 @@ -#Build Guide For Visual Studio 2019 or Qt Creator -##Tools +# Build Guide For Visual Studio 2019 or Qt Creator +## Tools -###git +### git Install [git](https://git-scm.com/downloads). -###Visual Studio +### Visual Studio Install [Microsoft Visual Studio 2019 or later](https://www.visualstudio.com/downloads/), then install the latest updates. -###Qt +### Qt Install Qt for Windows 64-bit (VS 2017) 5.12.8 or later (http://www.qt.io/download/). @@ -17,17 +17,17 @@ Add system environment variable named `QTPATH` and point it to the location of t `C:\Qt\5.12.8\msvc2017_64` -###Wix +### Wix To build the installer, you must have Wix installed. If you are unconcerned with it, you can skip this step and just dismiss the warning that shows when opening the solution later. It's recommended you ignore the installer since official builds are provided on this page. -###CMake +### CMake Install [CMake](https://cmake.org/download/) and be sure to check the option to add it to the system path. -##Obtaining source +## Obtaining source -###This project +### This project Open up the Visual Studio x64 Native Tools Command Prompt. @@ -39,7 +39,7 @@ Create a new folder in your development area named fractorium: `git clone https://mfeemster@bitbucket.org/mfeemster/fractorium.git` -###Prerequisites +### Prerequisites There are six prerequisite dependencies. One of them must be downloaded manually: @@ -103,9 +103,9 @@ This will download and build `glm libopenexr libpng libxml tbb zlib`. You will h ├─Imath-2_3.dll ``` -##Building with Qt Creator or Visual Studio +## Building with Qt Creator or Visual Studio -###Begin build with Qt Creator +### Begin build with Qt Creator Open the Qt Project `fractorium/main.pro` using Qt Creator with the default config of *Desktop Qt [version] MSVC2019 64bit*. Make sure *Shadow build* in *Edit build configuration* for both *Debug* and *Release* is unchecked. @@ -120,9 +120,9 @@ Ensure all projects are in the *Release* configuration and build main.pro. The outputs will be placed in `fractorium/Bin/release` several minutes later if no error occurs. -###Begin build with Visual Studio +### Begin build with Visual Studio -####Visual Studio Qt Addon +#### Visual Studio Qt Addon Install the [Visual Studio Qt Addon](http://www.qt.io/download/). @@ -140,7 +140,7 @@ Open the file Fractorium.sln under Builds/MSVC/2019 Set the configuration to release, and build all. -###Outputs +### Outputs The outputs will be the same whether Visual Studio or Qt Creator was used, however their locations will be different. @@ -216,7 +216,7 @@ To run on a computer without Visual Studio 2017, these files also need to be in or you can install [Visual C++ Redistributable Packages for Visual Studio 2019 (64 bit)](https://www.visualstudio.com/downloads/) -##Final file structure for distribution +## Final file structure for distribution ``` [YOUR FOLDER] From a0406174b13dc414448c82b18ef998ad9051e350 Mon Sep 17 00:00:00 2001 From: Matt Feemster Date: Mon, 14 Mar 2022 13:19:08 +0000 Subject: [PATCH 3/3] BuildGuideQtCreator.md edited online with Bitbucket --- Data/BuildGuideQtCreator.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Data/BuildGuideQtCreator.md b/Data/BuildGuideQtCreator.md index fe5febf..49b2a82 100644 --- a/Data/BuildGuideQtCreator.md +++ b/Data/BuildGuideQtCreator.md @@ -74,12 +74,6 @@ This will download and build `glm libopenexr libpng libxml tbb zlib`. You will h │ ├─Deps │ - ├─Include - │ - ├─OpenEXR - │ - ├─*.h - │ ├─libjpeg.lib ├─libpng.lib ├─libxml2.lib