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

Function loadRawFile

cpp/5_Domain_Specific/marchingCubes/marchingCubes.cpp:311–327  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////////// Load raw data from disk ///////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

309// Load raw data from disk
310////////////////////////////////////////////////////////////////////////////////
311uchar *loadRawFile(char *filename, int size)
312{
313 FILE *fp = fopen(filename, "rb");
314
315 if (!fp) {
316 fprintf(stderr, "Error opening file '%s'\n", filename);
317 return 0;
318 }
319
320 uchar *data = (uchar *)malloc(size);
321 size_t read = fread(data, 1, size, fp);
322 fclose(fp);
323
324 printf("Read '%s', %d bytes\n", filename, (int)read);
325
326 return data;
327}
328
329void dumpFile(void *dData, int data_bytes, const char *file_name)
330{

Callers 1

initMCFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected