MCPcopy Create free account
hub / github.com/NVIDIA/cuda-samples / loadRawFile

Function loadRawFile

cpp/0_Introduction/simpleTexture3D/simpleTexture3D.cpp:262–278  ·  view source on GitHub ↗

Load raw data from disk

Source from the content-addressed store, hash-verified

260
261// Load raw data from disk
262uchar *loadRawFile(const char *filename, size_t size)
263{
264 FILE *fp = fopen(filename, "rb");
265
266 if (!fp) {
267 fprintf(stderr, "Error opening file '%s'\n", filename);
268 return 0;
269 }
270
271 uchar *data = (uchar *)malloc(size);
272 size_t read = fread(data, 1, size, fp);
273 fclose(fp);
274
275 printf("Read '%s', %zu bytes\n", filename, read);
276
277 return data;
278}
279
280void initGL(int *argc, char **argv)
281{

Callers 1

loadVolumeDataFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected