-
Notifications
You must be signed in to change notification settings - Fork 295
AVX512 version for POVRAY #452
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
Open
Srihari-mcw
wants to merge
8
commits into
POV-Ray:release/v3.8.0
Choose a base branch
from
Srihari-mcw:feature_avx512_version1_final
base: release/v3.8.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e26c5c4
Add updates for AVX512 version of POV-RAY
Srihari-mcw 81f15b3
Update the sheet with additional performance details
Srihari-mcw 7066e75
Make updates to fix issues with OpenEXR dependency after latest Visua…
Srihari-mcw 1ac864b
Update the gui changes along with minor fixes
Srihari-mcw 8e06545
update indentation
Srihari-mcw ebfdc8c
Update README files
Srihari-mcw a925046
Fixes for issues with Noise8D and wrinkles functions definitions
jenetscaria-mcw 5190396
Added fma flag for unix setup with avx512
jenetscaria-mcw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
65 changes: 65 additions & 0 deletions
65
avx512_build_setup/ADDITIONAL_README_FOR_AVX512_Version.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| Notes for AVX512 Windows build | ||
| ============================== | ||
|
|
||
| The visual studio version was updated from vs2015 to vs2022 to enable support of AVX512 Version | ||
| 1. Set the configuration in solution file to Release-AVX512 | x64 | ||
| 2. Select the 'Generic POV-Ray > povbase' project and expand 'Backend Headers', then open the | ||
| file `build.h`(source/base/build.h) listed within it.In it replace with name | ||
| and email of person who builds the code in `BUILT_BY` flag and comment the #error directive (line 129) | ||
| 3. In syspovconfig.h(windows/povconfig/syspovconfig.h) uncomment the #define _CONSOLE. (line 56) | ||
| The AVX512 version was developed with the console version. | ||
| The GUI build has been skipped in the solution file. | ||
| **Note:** (Presently with the updated code the GUI project is skipped for building, | ||
| as the cmedit64.dll and povcmax64.dll from official windows distribution are | ||
| incompatible with VS2022. The console version alone is available to build and test). | ||
| 4. Build the solution file and in the vs2022/bin64 folder we can run the POVRAY examples with povconsole-avx512.exe. | ||
| ``` | ||
| General command example - povconsole-avx512.exe +Ibenchmark.pov | ||
| Single worker thread - povconsole-avx512.exe +WT1 benchmark.pov | ||
| Output image - benchmark.png | ||
| ``` | ||
| 5. Results with the AVX512 version has been attached in the same folder. | ||
|
|
||
| Notes for UNIX build | ||
| ==================== | ||
|
|
||
| Dependencies for unix build | ||
| ``` | ||
| libboost-dev | ||
| libboost-date-time-dev | ||
| libboost-thread-dev | ||
| libz-dev | ||
| libpng-dev | ||
| libjpeg-dev | ||
| libtiff-dev | ||
| libopenexr-dev | ||
| pkg-config (if its already not there) | ||
| ``` | ||
|
|
||
| Steps : | ||
| Generating configure and building the code : | ||
| ``` | ||
| % cd unix/ | ||
| % ./prebuild.sh | ||
| % cd ../ | ||
| % ./configure COMPILED_BY="your name <email@address>" | ||
| % make | ||
| ``` | ||
|
|
||
| To build with icpc : | ||
| ``` | ||
| % source /opt/intel/oneapi/setvars.sh | ||
| % cd unix/ | ||
| % ./prebuild.sh | ||
| % cd ../ | ||
| % ./configure COMPILED_BY="your name <email@address>" CXX=icpc | ||
| % make | ||
| ``` | ||
|
|
||
| Sample commands (inside the unix folder) : | ||
| ``` | ||
| General command example - ./povray +Ibenchmark.pov | ||
| Single worker thread - ./povray +WT1 benchmark.pov | ||
| Output image - benchmark.png | ||
| ``` | ||
|
|
Binary file added
BIN
+24.7 KB
avx512_build_setup/POVRAY Compiled Results - AVX512 - AMD 7600X and Intel I5-1035 G1.xlsx
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| //****************************************************************************** | ||
| /// | ||
| /// @file platform/x86/avx512/avx5123noise.h | ||
| /// | ||
| /// This file contains declarations related to implementations of the noise | ||
| /// generator optimized for the AVX512 instruction set. | ||
| /// | ||
| /// @copyright | ||
| /// @parblock | ||
| /// | ||
| /// Persistence of Vision Ray Tracer ('POV-Ray') version 3.8. | ||
| /// Copyright 1991-2017 Persistence of Vision Raytracer Pty. Ltd. | ||
| /// | ||
| /// POV-Ray is free software: you can redistribute it and/or modify | ||
| /// it under the terms of the GNU Affero General Public License as | ||
| /// published by the Free Software Foundation, either version 3 of the | ||
| /// License, or (at your option) any later version. | ||
| /// | ||
| /// POV-Ray is distributed in the hope that it will be useful, | ||
| /// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| /// GNU Affero General Public License for more details. | ||
| /// | ||
| /// You should have received a copy of the GNU Affero General Public License | ||
| /// along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| /// | ||
| /// ---------------------------------------------------------------------------- | ||
| /// | ||
| /// POV-Ray is based on the popular DKB raytracer version 2.12. | ||
| /// DKBTrace was originally written by David K. Buck. | ||
| /// DKBTrace Ver 2.0-2.12 were written by David K. Buck & Aaron A. Collins. | ||
| /// | ||
| /// @endparblock | ||
| /// | ||
| //****************************************************************************** | ||
|
|
||
| #ifndef POVRAY_AVX512NOISE_H | ||
| #define POVRAY_AVX512NOISE_H | ||
|
|
||
| #include "core/configcore.h" | ||
| #include "core/math/vector.h" | ||
|
|
||
| #ifdef TRY_OPTIMIZED_NOISE_AVX512 | ||
|
|
||
| namespace pov | ||
| { | ||
|
|
||
| extern const bool kAVX512NoiseEnabled; | ||
| void AVX512NoiseInit(); | ||
|
|
||
| /// Optimized Noise function for single input for AVX512 architecture | ||
| DBL AVX512Noise(const Vector3d& EPoint, int noise_generator); | ||
|
|
||
| /// Optimized DNoise function for single input for AVX512 architecture | ||
| void AVX512DNoise(Vector3d& result, const Vector3d& EPoint); | ||
|
|
||
| /// Optimized Noise function for two inputs using AVX512 instructions | ||
| /// @author Optimized by MCW | ||
| void AVX512Noise2D(const Vector3d& EPoint, int noise_generator, double& value); | ||
|
|
||
| /// Optimized DNoise function for two inputs using AVX512 instructions | ||
| /// @author Optimized by MCW | ||
| void AVX512DNoise2D(Vector3d& result, const Vector3d& EPoint); | ||
|
|
||
| /// Optimized Noise function for 8 multiples of single input using AVX512 instructions. | ||
| /// @author Optimized by MCW | ||
| DBL AVX512Noise8D(const Vector3d& EPoint, int noise_generator); | ||
|
|
||
| } | ||
|
|
||
| #endif // TRY_OPTIMIZED_NOISE_AVX512 | ||
|
|
||
| #endif // POVRAY_AVX512NOISE_H |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
two constants with the same value? Intentional or by mistake?
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.
Both FMA4 and AVX512 constants are indeed set to 1 << 16. However, for cpuid information comparison to detect machine architecture information, AVX512 is using data from the EBX register
povray/platform/x86/cpuid.cpp
Line 229 in e26c5c4
povray/platform/x86/cpuid.cpp
Line 236 in e26c5c4