Skip to content

Commit

Permalink
Merge pull request Apress#5 from breyerml/prefetch_memadvise_read_onl…
Browse files Browse the repository at this point in the history
…y_data_fix

changed kernel to use 'read_only_data' (otherwise never used)
  • Loading branch information
jamesreinders authored Nov 18, 2021
2 parents 2f558aa + c3a3b3f commit 3242729
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ int main() {

for (int b = 0; b < NUM_BLOCKS; b++) {
Q.parallel_for(range{BLOCK_SIZE}, e,
[=](id<1> i) { data[b * BLOCK_SIZE + i] += data[i]; });
[=](id<1> i) { data[b * BLOCK_SIZE + i] += read_only_data[i]; });
if ((b + 1) < NUM_BLOCKS) {
// Prefetch next block
e = Q.prefetch(data + (b + 1) * BLOCK_SIZE, BLOCK_SIZE);
Expand Down

0 comments on commit 3242729

Please sign in to comment.