Skip to content

Type support needs to check the extensions only. #4

@jungpark-mlir

Description

@jungpark-mlir

is_fp64_capable = (uint)cl_device.getInfo<CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE>()*(uint)contains(cl_device.getInfo<CL_DEVICE_EXTENSIONS>(), "cl_khr_fp64");

Hello,

I've been learning how it works and have some questions about it.
Firstly, I'm not sure about the logic it determines the support for the data types.
I believe CL_DEVICE_NATIVE_VECTOR_WIDTH_* doesn't necessarily reflect the presence of a given type support.

The specification only says,

If double precision is not supported, CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE must return 0.
If the cl_khr_fp16 extension is not supported,CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF must return 0.

Not the other way around.
Checking support for the double/half types only need to query cl_khr_fp64, cl_khr_fp16 extensions respectively.
Also I wonder if the other types need to be checked because they're supposed to be supported as builtin scalar type.

I might be missing something but please have a look and let me know what you think about it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions