inducer / inducer/compyte

Signed/unsigned char on different platforms

Open
#45 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
59
Forks
22
PR merge metrics
No merged PRs in 30d

Description

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).

https://github.com/inducer/compyte/blob/d4549d4c711513e2cc098d3f5d4e918eac53ee7a/dtypes.py#L122

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.