MCPcopy Create free account
hub / github.com/ROCm/hip / populate_data_pointer

Function populate_data_pointer

docs/tools/example_codes/load_module_ex_cuda.cpp:46–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46void* populate_data_pointer()
47{
48 auto filename = std::string{"myKernel.ptx"};
49 std::fstream file{filename, std::ios::in | std::ios::binary | std::ios::ate};
50 if(!file.is_open())
51 {
52 std::cerr << "Error opening file " << filename << std::endl;
53 std::exit(EXIT_FAILURE);
54 }
55
56 auto filesize = file.tellg();
57 auto storage = new char[filesize];
58
59 file.seekg(0, std::ios::beg);
60 file.read(storage, filesize);
61
62 return storage;
63}
64
65int main()
66{

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected