Skip to content

Commit 2e5c53a

Browse files
committed
Change class to be able to use an external storage class
This allows to combine the logs of multiple different arrays, storing the read and write accesses in the correct order of access
1 parent 50f8928 commit 2e5c53a

2 files changed

Lines changed: 286 additions & 228 deletions

File tree

examples/basic/normal.cu

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ __global__ void kernel(int prob_size, CudaMemAccessLogger<int> * input, CudaMemA
2121
}
2222

2323
int main(){
24-
constexpr int prob_size = 100;
24+
constexpr int prob_size = 1000;
2525

2626
std::vector<int> h_input(prob_size);
2727
std::iota(h_input.begin(), h_input.end(), 0);
@@ -34,8 +34,11 @@ int main(){
3434

3535
checkCudaError(cudaMemcpy(d_input, h_input.data(), sizeof(int)* prob_size, cudaMemcpyHostToDevice));
3636

37-
CudaMemAccessLogger<int> input(d_input);
38-
CudaMemAccessLogger<int> output(d_output);
37+
CudaMemAccessStorage<int> memAccessStorage(10000);
38+
39+
40+
CudaMemAccessLogger<int> input(d_input, &memAccessStorage);
41+
CudaMemAccessLogger<int> output(d_output, &memAccessStorage);
3942

4043
constexpr int threads = 32;
4144
constexpr int blocks = (prob_size/threads)+1;
@@ -44,10 +47,7 @@ int main(){
4447
checkCudaError(cudaGetLastError());
4548
cudaDeviceSynchronize();
4649

47-
auto data = input.getGlobalSettings();
48-
49-
input.analyze("../../../html/basic_template.html", "../../../out/basic_input.html");
50-
output.analyze("../../../html/basic_template.html", "../../../out/basic_output.html");
50+
memAccessStorage.generateOutput("../../../html/basic_template.html", "../../../out/basic.html");
5151

5252
checkCudaError(cudaMemcpy(h_output.data(), d_output, sizeof(int)*prob_size, cudaMemcpyDeviceToHost));
5353

0 commit comments

Comments
 (0)