Skip to content

Commit

Permalink
Minor adjustments for consistency
Browse files Browse the repository at this point in the history
Signed-off-by: Engin Kayraklioglu <e-kayrakli@users.noreply.github.com>
  • Loading branch information
e-kayrakli committed Feb 16, 2024
1 parent a2024fc commit 81734cc
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion test/gpu/native/examples/blog-data/allocation.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ on here.gpus[0] {
writeln(DevArr); // prints "1 1 1 1 1"
}

writeln(HostArr); // prints "1 1 1 1 1"
writeln(HostArr); // prints "2 2 2 2 2"
2 changes: 1 addition & 1 deletion test/gpu/native/examples/blog-data/distributed.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ coforall (loc, locChunk) in zip(Locales, chunks(1..n, numLocales)) {
const numSlices = gpuChunk.size/sliceSize; // assume divisibility

coforall chunk in chunks(gpuChunk, numSlices) {
var DevArr: [chunk] int; // allocated per device
var DevArr: [chunk] int; // allocated on the device

DevArr = HostArr[chunk]; // copy a slice from host to device
DevArr += 1; // executes on GPU as a kernel
Expand Down
2 changes: 1 addition & 1 deletion test/gpu/native/examples/blog-data/movement.chpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var HostArr: [1..5] int; // allocated on the host
HostArr += 1; // executes on [multicore] CPU
HostArr = 1; // executes on [multicore] CPU

on here.gpus[0] {
var DevArr: [1..5] int; // allocated on the device
Expand Down
2 changes: 1 addition & 1 deletion test/gpu/native/examples/blog-data/overlap.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import RangeChunk.chunks;
config const n = 32; // now, our application has `--n` to set this!
config const sliceSize = 4; // number of elements per slice

const numSlices = n/sliceSize; // assume divisibility for simplicity
const numSlices = n/sliceSize; // assume divisibility for simplicity

var HostArr: [1..n] int; // allocated on the host
HostArr = 1; // executes on [multicore] CPU
Expand Down
12 changes: 6 additions & 6 deletions test/gpu/native/examples/blog-data/slices.chpl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import RangeChunk.chunks;

config const n = 32; // now, our application has `--n` to set this!
config const sliceSize = 4; // number of elements per slice
config const n = 32; // now, our application has `--n` to set this!
config const sliceSize = 4; // number of elements per slice

const numSlices = n/sliceSize; // assume divisibility for simplicity
const numSlices = n/sliceSize; // assume divisibility for simplicity

var HostArr: [1..n] int; // allocated on the host
HostArr = 1; // executes on [multicore] CPU
Expand All @@ -12,9 +12,9 @@ on here.gpus[0] {
var DevArr: [1..n] int; // allocated on the device

for chunk in chunks(1..n, numSlices) {
DevArr = HostArr[chunk]; // copy a slice from host to device
DevArr += 1; // executes on GPU as a kernel
HostArr[chunk] = DevArr; // copy from device to a slice on host
DevArr = HostArr[chunk]; // copy a slice from host to device
DevArr += 1; // executes on GPU as a kernel
HostArr[chunk] = DevArr; // copy from device to a slice on host
}
}

Expand Down

0 comments on commit 81734cc

Please sign in to comment.