types - What's a good alternative to uint8_t when it is not provided by the compiler? -


i'm using nvcc compile cuda kernel. unfortunately, nvcc doesn't seem support uint8_t, although support int8_t (!). i'd not use unsigned char, portability, readability, , sanity reasons. there alternative?


just forestall possible misunderstanding, here details.

$ nvcc --version nvcc: nvidia (r) cuda compiler driver copyright (c) 2005-2010 nvidia corporation built on mon_jun__7_18:56:31_pdt_2010 cuda compilation tools, release 3.1, v0.2.1221 

code containing

int8_t test = 0; 

is fine, code containing

uint8_t test = 0; 

throws error message like

test.cu(8): error: identifier "uint8_t" undefined 

c99 integer types not "defined compiler" - defined in <stdint.h>.

try:

#include <stdint.h> 

Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -