Skip to content

Does OpenCL support rvv Intrinsic functions? #121080

@zhaosiying12138

Description

@zhaosiying12138

For example,I have a test_rvv_intrinsics.cl file:

#include <riscv_vector.h>

void softmax_fp16()
{
    size_t vlmax = __riscv_vsetvlmax_e16m4();
    _Float16 *tmp_src_data;
    vfloat16m4_t vx_data = __riscv_vle16_v_f16m4(tmp_src_data, vlmax);
}

And I compile it with the following command:

clang --target=riscv64 -march=rv64imafdcv_zfh_zvfh_zve32f -S -c test_rvv_intrinsics.cl -o -

Clang compiles failed and report the following message:

clang: warning: argument unused during compilation: '-c' [-Wunused-command-line-argument]
test_rvv_intrinsics.cl:7:50: error: passing '__generic _Float16 *__private' to parameter of type 'const _Float16 *' changes address space of pointer
    7 |     vfloat16m4_t vx_data = __riscv_vle16_v_f16m4(tmp_src_data, vlmax);
      |                                                  ^~~~~~~~~~~~
test_rvv_intrinsics.cl:7:28: note: passing argument to parameter here
    7 |     vfloat16m4_t vx_data = __riscv_vle16_v_f16m4(tmp_src_data, vlmax);
      |                            ^
1 error generated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    OpenCLquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions