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

Function loadRawFile

cpp/3_CUDA_Features/bindlessTexture/bindlessTexture.cpp:251–267  ·  view source on GitHub ↗

Load raw data from disk

Source from the content-addressed store, hash-verified

249
250// Load raw data from disk
251uchar *loadRawFile(const char *filename, size_t size)
252{
253 FILE *fp = fopen(filename, "rb");
254
255 if (!fp) {
256 fprintf(stderr, "Error opening file '%s'\n", filename);
257 return 0;
258 }
259
260 uchar *data = (uchar *)malloc(size);
261 size_t read = fread(data, 1, size, fp);
262 fclose(fp);
263
264 printf("Read '%s', %zu bytes\n", filename, read);
265
266 return data;
267}
268
269void initGL(int *argc, char **argv)
270{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected