-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1fe4d11
commit 9b62871
Showing
6 changed files
with
33 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
template<typename LB> | ||
__global__ | ||
__attribute__((annotate("jit"))) | ||
void kernel(LB lb) { | ||
struct kernel_body_t { | ||
__device__ void operator()() { printf("Kernel body"); } | ||
}; | ||
|
||
const kernel_body_t kernel_body{}; | ||
|
||
template <typename LB> | ||
__global__ __attribute__((annotate("jit"))) void kernel(LB lb) { | ||
lb(); | ||
} | ||
|
||
template <typename T> | ||
gpuError_t launcher(T lb) { | ||
auto func = reinterpret_cast<const void*>( & kernel<T> ); | ||
void *args[] = {(void*)&lb }; | ||
template <typename T> gpuError_t launcher(T lb) { | ||
auto func = reinterpret_cast<const void *>(&kernel<T>); | ||
void *args[] = {(void *)&lb}; | ||
return gpuLaunchKernel(func, 1, 1, args, 0, 0); | ||
} |