Conversation
…ommit ca0e0b4e.
Closed
topperc
reviewed
Nov 7, 2024
common/simd/riscv/emulation.h
Outdated
| rm = 0b01; | ||
| } | ||
|
|
||
| asm volatile("csrw vxrm,%0" :: "r"(rm)); |
There was a problem hiding this comment.
I think _mm_setcsr is for floating point rounding modes. So this should be a write to frm not vxrm.
Author
There was a problem hiding this comment.
Update SSE2RVV to include the proper implementation.
|
Any plans to get this moving forward? |
Collaborator
|
We don't have the resources to test and maintain a RISC-V port at the moment. We'd be happy to accept this PR, but make it clear in the documentation and build scripts that for now, this is considered experimental. |
|
Maybe we can test this on Spacemit K1 chip or wait for SG2044, they both have RVV 1.0 support. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The port is based on pattonkan/sse2rvv@ca0e0b4, which for now supports SSE2 and SSE4.2 that embree uses. It is verified using Ubuntu 24.04.1 RISC-V preinstalled server image from https://cdimage.ubuntu.com/releases/24.04/release/ with QEMU on Ubuntu 24.04.
Note this is just the initial port of RVV and has a limitation for VLEN=128 only. We expect further performance improvement from porting the other extensions.
Test steps:
Follow https://wiki.ubuntu.com/RISC-V/QEMU to install required packages and run the QEMU using the following command with vector extension enabled:
Use clang-18 to build embree in QEMU guest
sudo apt update; sudo apt install cmake libtbb-dev libglfw3-dev clang-18cd embree; mkdir build; cd build; cmake -DCMAKE_CXX_COMPILER=clang++-18 -DCMAKE_C_COMPILER=clang-18 ..; make -j4; sudo make installUntar the archive https://github.com/RenderKit/embree/releases/download/v4.3.3/embree-4.3.3-testing.tar.gz to /usr/local and run tests
cd /usr/local/testing; sudo cmake -B build -DCMAKE_CXX_COMPILER=clang++-18 -DCMAKE_C_COMPILER=clang-18 -DEMBREE_TESTING_INTENSITY=1; sudo cmake --build build --target testThe results are:
Running embree_bvh_builder alone is passed, and running embree_verify will have a segmentation fault in SSE4.2.regression_static_memory_monitor from libtbb for an invalid register value. Use regex to select only the test is passed though. This doesn't seem relate to the port and can be listed as a known issue.