Skip to content

Signed/unsigned char on different platforms #45

@matthiasdiener

Description

@matthiasdiener

I'm not sure how much difference it makes in practice, but the char type in C/C++ isn't guaranteed to be signed or unsigned.

By default, x86/M1 seem to treat char as signed, but ppc64le treats it as unsigned. This can also be modified by compiler options (e.g., https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gcc/C-Dialect-Options.html#index-funsigned-char).

reg.get_or_register_dtype(["signed char", "char"], np.int8)

OpenCL seems to define it as signed: https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_C.html#built-in-scalar-data-types

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