Skip to content

Commit

Permalink
working on experiments for benchmarking.
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick McCormick committed Feb 6, 2024
1 parent f510df1 commit ab61a3c
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion kitsune/experiments/euler3d/euler3d-forall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ int main(int argc, char** argv)
return 0;
}

int iterations = 2000;
int iterations = 4000;
if (argc > 2)
iterations = atoi(argv[2]);

Expand Down
2 changes: 1 addition & 1 deletion kitsune/experiments/euler3d/euler3d-kokkos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ int main(int argc, char** argv)
return 0;
}

int iterations = 2000;
int iterations = 4000;
if (argc > 2)
iterations = atoi(argv[2]);

Expand Down
2 changes: 1 addition & 1 deletion kitsune/experiments/launch-attr/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ all: ${targets}
srad-forall.cuda.${host_arch}: srad-forall.cpp
@echo $@
@$(TIME_CMD) $(KIT_CXX) $(TAPIR_CUDA_FLAGS) -DTHREADS_PER_BLOCK=$(THREADS_PER_BLOCK) \
-mllvm --cuabi-occupancy-launches=false -o $@ $< -Xlinker -rpath=$(KITSUNE_PREFIX)/lib
-o $@ $< -Xlinker -rpath=$(KITSUNE_PREFIX)/lib
@$(FILE_SIZE)

srad-forall-exprs.cuda.${host_arch}: srad-forall-exprs.cpp
Expand Down
7 changes: 5 additions & 2 deletions kitsune/experiments/launch-attr/srad-forall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,13 @@ int main(int argc, char* argv[])

cout << " Starting benchmark...\n" << std::flush;
auto start_time = chrono::steady_clock::now();
[[kitsune::launch(8)]]
forall(int i = 0; i < rows; i++) {
iN[i] = i-1;
iS[i] = i+1;
}

[[kitsune::launch(8)]]
forall(int j=0; j < cols; j++) {
jW[j] = j-1;
jE[j] = j+1;
Expand All @@ -126,6 +128,7 @@ int main(int argc, char* argv[])
jW[0] = 0;
jE[cols-1] = cols-1;

[[kitsune::launch(64)]]
forall(int k = 0; k < size_I; k++)
J[k] = (float)exp(I[k]) ;

Expand All @@ -149,7 +152,7 @@ int main(int argc, char* argv[])
q0sqr = varROI / (meanROI*meanROI);

auto loop1_start_time = chrono::steady_clock::now();
[[kitsune::launch(THREADS_PER_BLOCK)]]
[[kitsune::launch(16)]]
forall(int i = 0 ; i < rows; i++) {

for(int j = 0; j < cols; j++) {
Expand Down Expand Up @@ -191,7 +194,7 @@ int main(int argc, char* argv[])
loop1_min_time = etime;

auto loop2_start_time = chrono::steady_clock::now();
[[kitsune::launch(THREADS_PER_BLOCK)]]
[[kitsune::launch(8)]]
forall(int i = 0; i < rows; i++) {
for(int j = 0; j < cols; j++) {
// current index
Expand Down
2 changes: 1 addition & 1 deletion kitsune/experiments/launch-bench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ echo "gpu: $gpuname" >> $outfile
echo "time stamp: $tstamp" >> $outfile
echo "ThreadsPerBlock,Time" >> $outfile

for tpb in {16..1024..16}
for tpb in {8..512..16}
do
export KITCUDA_THREADS_PER_BLOCK=$tpb
echo " running '$*' with $tpb threads-per-block"
Expand Down
3 changes: 2 additions & 1 deletion kitsune/experiments/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ $(subdirs):
run: $(subdirs)
$(MAKE) -C $< $(MAKECMDGOALS)


launch_bench: $(subdirs)
$(MAKE) -C $< $(MAKECMDGOALS)

3 changes: 3 additions & 0 deletions kitsune/experiments/noforall/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ run: $(targets)

.PHONY: all clean run

launch_bench:
@echo "launch benchmark invalid... skipping..."

clean:
-rm -f *.${host_arch} *.ll *.o
-rm -f *~ core *.log
Expand Down
4 changes: 2 additions & 2 deletions kitsune/experiments/srad/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ srad-forall.hip.${host_arch}: srad-forall.cpp
@$(FILE_SIZE)

# kokkos-based tests (w/out views)
#srad-kokkos.cuda.kitsune.${host_arch}: srad-kokkos-no-view.cpp
# /usr/bin/time $(KIT_CXX) $(TAPIR_CUDA_FLAGS) $(KITSUNE_KOKKOS_FLAGS) -o $@ $< -Xlinker -rpath=$(KITSUNE_PREFIX)/lib
srad-kokkos.cuda.kitsune.${host_arch}: srad-kokkos-no-view.cpp
/usr/bin/time $(KIT_CXX) $(TAPIR_CUDA_FLAGS) $(KITSUNE_KOKKOS_FLAGS) -o $@ $< -Xlinker -rpath=$(KITSUNE_PREFIX)/lib
#srad-kokkos.hip.kitsune.${host_arch}: srad-kokkos-no-view.cpp
# /usr/bin/time $(KIT_CXX) $(TAPIR_HIP_FLAGS) -o $@ $< -Xlinker -rpath=$(KITSUNE_PREFIX)/lib

Expand Down

0 comments on commit ab61a3c

Please sign in to comment.