forked from opencv/opencv
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added cmake toolchain for RISC-V with clang.
- Added cross compile cmake file for target riscv64-clang - Extended cmake for RISC-V and added instruction checks - Created intrin_rvv.hpp with C++ version universal intrinsics
- Loading branch information
1 parent
9039284
commit ff4c387
Showing
9 changed files
with
1,782 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 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,23 @@ | ||
#include <stdio.h> | ||
|
||
#if defined(__riscv) | ||
# include <riscv_vector.h> | ||
# define CV_RVV 1 | ||
#endif | ||
|
||
#if defined CV_RVV | ||
int test() | ||
{ | ||
const float src[] = { 0.0f, 0.0f, 0.0f, 0.0f }; | ||
vfloat32m1_t val = vle32_v_f32m1((const float*)(src)); | ||
return (int)vfmv_f_s_f32m1_f32(val); | ||
} | ||
#else | ||
#error "RISC-V vector extension(RVV) is not supported" | ||
#endif | ||
|
||
int main() | ||
{ | ||
printf("%d\n", test()); | ||
return 0; | ||
} |
This file contains 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 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 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 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.