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

Function populate_data_pointer

docs/tools/example_codes/load_module_ex.cpp:44–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected