Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions libc/benchmarks/gpu/timing/amdgpu/timing.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ throughput_baseline(const cpp::array<T, N> &inputs) {
asm("" ::"s"(start));

T result{};

#pragma clang loop unroll(disable)
for (auto input : inputs) {
asm("" ::"v"(input));
result = input;
Expand Down Expand Up @@ -146,6 +148,8 @@ static LIBC_INLINE uint64_t throughput(F f, const cpp::array<T, N> &inputs) {
asm("" ::"s"(start));

T result{};

#pragma clang loop unroll(disable)
for (auto input : inputs) {
asm("" ::"v"(input));
result = f(input);
Expand Down Expand Up @@ -174,6 +178,8 @@ static LIBC_INLINE uint64_t throughput_baseline(
asm("" ::"s"(start));

T result{};

#pragma clang loop unroll(disable)
for (size_t i = 0; i < N; i++) {
T x = inputs1[i];
T y = inputs2[i];
Expand Down Expand Up @@ -206,6 +212,8 @@ static LIBC_INLINE uint64_t throughput(F f, const cpp::array<T, N> &inputs1,
asm("" ::"s"(start));

T result{};

#pragma clang loop unroll(disable)
for (size_t i = 0; i < N; i++) {
T x = inputs1[i];
T y = inputs2[i];
Expand Down
8 changes: 8 additions & 0 deletions libc/benchmarks/gpu/timing/nvptx/timing.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ throughput_baseline(const cpp::array<T, N> &inputs) {
asm("" ::"llr"(start));

T result{};

#pragma clang loop unroll(disable)
for (auto input : inputs) {
asm("" ::"r"(input));
result = input;
Expand Down Expand Up @@ -135,6 +137,8 @@ static LIBC_INLINE uint64_t throughput(F f, const cpp::array<T, N> &inputs) {
asm("" ::"llr"(start));

T result{};

#pragma clang loop unroll(disable)
for (auto input : inputs) {
asm("" ::"r"(input));
result = f(input);
Expand Down Expand Up @@ -163,6 +167,8 @@ static LIBC_INLINE uint64_t throughput_baseline(
asm("" ::"llr"(start));

T result{};

#pragma clang loop unroll(disable)
for (size_t i = 0; i < N; i++) {
T x = inputs1[i];
T y = inputs2[i];
Expand Down Expand Up @@ -195,6 +201,8 @@ static LIBC_INLINE uint64_t throughput(F f, const cpp::array<T, N> &inputs1,
asm("" ::"llr"(start));

T result{};

#pragma clang loop unroll(disable)
for (size_t i = 0; i < N; i++) {
T x = inputs1[i];
T y = inputs2[i];
Expand Down
Loading