Skip to content

Commit

Permalink
Fix flops calculation and tensor b stride calculation in the example …
Browse files Browse the repository at this point in the history
…36 (NVIDIA#1278)

* Fix flops calculation and tensor b stride calculation in the example 36

* Fix datatype

* Update gather_scatter_fusion.cu
  • Loading branch information
getianao authored Jan 8, 2024
1 parent 74d1f3e commit acba5be
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/36_gather_scatter_fusion/gather_scatter_fusion.cu
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ struct Options {
/// Compute performance in GFLOP/s
double gflops(double runtime_s) const {

// Number of real-valued multiply-adds
int64_t fmas = problem_size.product();
// Number of real-valued multiply-adds
int64_t fmas = problem_size.m() * int64_t(index_size) * problem_size.k();

// Two flops per multiply-add
return 2.0 * double(fmas) / double(1.0e9) / runtime_s;
Expand Down Expand Up @@ -349,7 +349,7 @@ int run(Options &options) {
tensor_c.device_data(), // <- reference to matrix C on device
tensor_d_scattered.device_data(), // <- reference to matrix D on device
tensor_a.layout().capacity(problem_size.mk()),
tensor_b.layout().capacity(cutlass::make_Coord(options.index_size, problem_size.n())),
tensor_b.layout().capacity(cutlass::make_Coord(options.index_size, problem_size.k())),
tensor_c.layout().capacity(problem_size.mn()),
tensor_d_scattered.layout().capacity(problem_size.mn()),
tensor_a.layout().stride(),
Expand Down

0 comments on commit acba5be

Please sign in to comment.