MCPcopy Create free account
hub / github.com/AdaptiveCpp/AdaptiveCpp / launch_kernel_from_module

Function launch_kernel_from_module

src/runtime/hip/hip_queue.cpp:121–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119};
120
121result launch_kernel_from_module(ihipModule_t *module,
122 std::string_view kernel_name,
123 const rt::range<3> &grid_size,
124 const rt::range<3> &block_size,
125 unsigned dynamic_shared_mem,
126 hipStream_t stream, void **kernel_args,
127 std::size_t *arg_sizes, std::size_t num_args) {
128
129 hipFunction_t kernel_func;
130 hipError_t err =
131 hipModuleGetFunction(&kernel_func, module, kernel_name.data());
132
133 if(err != hipSuccess) {
134 return make_error(__acpp_here(),
135 error_info{"hip_queue: could not extract kernel from module",
136 error_code{"HIP", static_cast<int>(err)}});
137 }
138
139 err = hipModuleLaunchKernel(kernel_func,
140 static_cast<unsigned>(grid_size.get(0)),
141 static_cast<unsigned>(grid_size.get(1)),
142 static_cast<unsigned>(grid_size.get(2)),
143 static_cast<unsigned>(block_size.get(0)),
144 static_cast<unsigned>(block_size.get(1)),
145 static_cast<unsigned>(block_size.get(2)),
146 dynamic_shared_mem, stream, kernel_args, nullptr);
147
148 if (err != hipSuccess) {
149 return make_error(__acpp_here(),
150 error_info{"hip_queue: could not submit kernel from module",
151 error_code{"HIP", static_cast<int>(err)}});
152 }
153
154
155 return make_success();
156}
157}
158
159

Calls 3

make_errorFunction · 0.85
make_successFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected