Download cmake/checks/cpu_rvv.cpp from tgollogly/test: direct link, hf CLI and curl.
- Browser
- Download file 1.09 kB
-
https://huggingface.co/tgollogly/test/resolve/main/cmake/checks/cpu_rvv.cpp
- Command line
-
hf download hf://tgollogly/test/cmake/checks/cpu_rvv.cpp
-
curl -L -o cpu_rvv.cpp https://huggingface.co/tgollogly/test/resolve/main/cmake/checks/cpu_rvv.cpp
1.09 kB
| int test() | |
| { | |
| const float src[] = { 0.0f, 0.0f, 0.0f, 0.0f }; | |
| uint64_t ptr[2] = {0x0908060504020100, 0xFFFFFFFF0E0D0C0A}; | |
| vuint8m1_t a = vreinterpret_v_u64m1_u8m1(vle64_v_u64m1(ptr, 2)); | |
| vfloat32m1_t val = vle32_v_f32m1((const float*)(src), 4); | |
| return (int)vfmv_f_s_f32m1_f32(val); | |
| } | |
| int test() | |
| { | |
| const float src[] = { 0.0f, 0.0f, 0.0f, 0.0f }; | |
| uint64_t ptr[2] = {0x0908060504020100, 0xFFFFFFFF0E0D0C0A}; | |
| vuint8m1_t a = __riscv_vreinterpret_v_u64m1_u8m1(__riscv_vle64_v_u64m1(ptr, 2)); | |
| vfloat32m1_t val = __riscv_vle32_v_f32m1((const float*)(src), 4); | |
| return (int)__riscv_vfmv_f_s_f32m1_f32(val); | |
| } | |
| int main() | |
| { | |
| printf("%d\n", test()); | |
| return 0; | |
| } | |