Blame view

3rdparty/opencv-4.5.4/cmake/checks/cpu_rvv.cpp 407 Bytes
f4334277   Hu Chunming   提交3rdparty
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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), 4);
      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;
  }