-
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.
Fix multiple annotations with RDC (#78)
Co-authored-by: Giorgis Georgakoudis <[email protected]>
- Loading branch information
1 parent
20b2677
commit 25133d7
Showing
7 changed files
with
70 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// clang-format off | ||
// RUN: ./multi_file_launcher.%ext | FileCheck %s --check-prefixes=CHECK,CHECK-FIRST | ||
// Second run uses the object cache. | ||
// RUN: ./multi_file_launcher.%ext | FileCheck %s --check-prefixes=CHECK,CHECK-SECOND | ||
// clang-format on | ||
#include <climits> | ||
#include <cstdio> | ||
|
||
#include "gpu_common.h" | ||
#include "launcher.hpp" | ||
|
||
void foo(); | ||
|
||
int main() { | ||
gpuErrCheck(launcher(kernel_body)); | ||
gpuErrCheck(gpuDeviceSynchronize()); | ||
foo(); | ||
gpuErrCheck(gpuDeviceSynchronize()); | ||
return 0; | ||
} | ||
|
||
// CHECK: Kernel body | ||
// CHECK: Kernel body | ||
// CHECK: JitCache hits 0 total 2 | ||
// CHECK: HashValue {{[0-9]+}} NumExecs 1 NumHits 0 | ||
// CHECK: HashValue {{[0-9]+}} NumExecs 1 NumHits 0 | ||
// CHECK-FIRST: JitStorageCache hits 0 total 2 | ||
// CHECK-SECOND: JitStorageCache hits 2 total 2 |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#include <stdio.h> | ||
|
||
#include "gpu_common.h" | ||
#include "launcher.hpp" | ||
|
||
void foo() { gpuErrCheck(launcher(kernel_body)); } |
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 |
---|---|---|
|
@@ -28,4 +28,4 @@ | |
gpuGetErrorString(err)); \ | ||
abort(); \ | ||
} \ | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
struct kernel_body_t { | ||
__device__ void operator()() { printf("Kernel body\n"); } | ||
}; | ||
|
||
const kernel_body_t kernel_body{}; | ||
|
||
template <typename LB> | ||
__global__ __attribute__((annotate("jit"))) void kernel(LB lb) { | ||
lb(); | ||
} | ||
|
||
template <typename T> gpuError_t __attribute__((always_inline)) launcher(T lb) { | ||
auto func = reinterpret_cast<const void *>(&kernel<T>); | ||
void *args[] = {(void *)&lb}; | ||
return gpuLaunchKernel(func, 1, 1, args, 0, 0); | ||
} |