Skip to content

Commit 96e0bae

Browse files
Remove redundant (void)output;
1 parent cfa9838 commit 96e0bae

File tree

2 files changed

+8
-24
lines changed

2 files changed

+8
-24
lines changed

libc/benchmarks/gpu/timing/amdgpu/timing.h

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ throughput_baseline(const cpp::array<T, N> &inputs) {
115115

116116
cpp::atomic_thread_fence(cpp::MemoryOrder::ACQ_REL);
117117
uint64_t start = gpu::processor_clock();
118-
119118
asm("" ::"s"(start));
120119

121120
T result{};
@@ -126,11 +125,10 @@ throughput_baseline(const cpp::array<T, N> &inputs) {
126125
}
127126

128127
uint64_t stop = gpu::processor_clock();
129-
cpp::atomic_thread_fence(cpp::MemoryOrder::ACQ_REL);
130128
asm("" ::"s"(stop));
129+
cpp::atomic_thread_fence(cpp::MemoryOrder::ACQ_REL);
131130

132131
volatile auto output = result;
133-
(void)output;
134132

135133
return stop - start;
136134
}
@@ -146,7 +144,6 @@ static LIBC_INLINE uint64_t throughput(F f, const cpp::array<T, N> &inputs) {
146144

147145
cpp::atomic_thread_fence(cpp::MemoryOrder::ACQ_REL);
148146
uint64_t start = gpu::processor_clock();
149-
150147
asm("" ::"s"(start));
151148

152149
T result{};
@@ -157,11 +154,10 @@ static LIBC_INLINE uint64_t throughput(F f, const cpp::array<T, N> &inputs) {
157154
}
158155

159156
uint64_t stop = gpu::processor_clock();
160-
cpp::atomic_thread_fence(cpp::MemoryOrder::ACQ_REL);
161157
asm("" ::"s"(stop));
158+
cpp::atomic_thread_fence(cpp::MemoryOrder::ACQ_REL);
162159

163160
volatile auto output = result;
164-
(void)output;
165161

166162
const uint64_t measured = stop - start;
167163
return measured > baseline ? (measured - baseline) : 0;
@@ -176,7 +172,6 @@ static LIBC_INLINE uint64_t throughput_baseline(
176172

177173
cpp::atomic_thread_fence(cpp::MemoryOrder::ACQ_REL);
178174
uint64_t start = gpu::processor_clock();
179-
180175
asm("" ::"s"(start));
181176

182177
T result{};
@@ -189,11 +184,10 @@ static LIBC_INLINE uint64_t throughput_baseline(
189184
}
190185

191186
uint64_t stop = gpu::processor_clock();
192-
cpp::atomic_thread_fence(cpp::MemoryOrder::ACQ_REL);
193187
asm("" ::"s"(stop));
188+
cpp::atomic_thread_fence(cpp::MemoryOrder::ACQ_REL);
194189

195190
volatile auto output = result;
196-
(void)output;
197191

198192
return stop - start;
199193
}
@@ -210,7 +204,6 @@ static LIBC_INLINE uint64_t throughput(F f, const cpp::array<T, N> &inputs1,
210204

211205
cpp::atomic_thread_fence(cpp::MemoryOrder::ACQ_REL);
212206
uint64_t start = gpu::processor_clock();
213-
214207
asm("" ::"s"(start));
215208

216209
T result{};
@@ -223,11 +216,10 @@ static LIBC_INLINE uint64_t throughput(F f, const cpp::array<T, N> &inputs1,
223216
}
224217

225218
uint64_t stop = gpu::processor_clock();
226-
cpp::atomic_thread_fence(cpp::MemoryOrder::ACQ_REL);
227219
asm("" ::"s"(stop));
220+
cpp::atomic_thread_fence(cpp::MemoryOrder::ACQ_REL);
228221

229222
volatile auto output = result;
230-
(void)output;
231223

232224
const uint64_t measured = stop - start;
233225
return measured > baseline ? (measured - baseline) : 0;

libc/benchmarks/gpu/timing/nvptx/timing.h

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ throughput_baseline(const cpp::array<T, N> &inputs) {
105105

106106
cpp::atomic_thread_fence(cpp::MemoryOrder::ACQ_REL);
107107
uint64_t start = gpu::processor_clock();
108-
109108
asm("" ::"llr"(start));
110109

111110
T result{};
@@ -116,11 +115,10 @@ throughput_baseline(const cpp::array<T, N> &inputs) {
116115
}
117116

118117
uint64_t stop = gpu::processor_clock();
119-
cpp::atomic_thread_fence(cpp::MemoryOrder::ACQ_REL);
120118
asm("" ::"r"(stop));
119+
cpp::atomic_thread_fence(cpp::MemoryOrder::ACQ_REL);
121120

122121
volatile auto output = result;
123-
(void)output;
124122

125123
return stop - start;
126124
}
@@ -136,7 +134,6 @@ static LIBC_INLINE uint64_t throughput(F f, const cpp::array<T, N> &inputs) {
136134

137135
cpp::atomic_thread_fence(cpp::MemoryOrder::ACQ_REL);
138136
uint64_t start = gpu::processor_clock();
139-
140137
asm("" ::"llr"(start));
141138

142139
T result{};
@@ -147,11 +144,10 @@ static LIBC_INLINE uint64_t throughput(F f, const cpp::array<T, N> &inputs) {
147144
}
148145

149146
uint64_t stop = gpu::processor_clock();
150-
cpp::atomic_thread_fence(cpp::MemoryOrder::ACQ_REL);
151147
asm("" ::"r"(stop));
148+
cpp::atomic_thread_fence(cpp::MemoryOrder::ACQ_REL);
152149

153150
volatile auto output = result;
154-
(void)output;
155151

156152
const uint64_t measured = stop - start;
157153
return measured > baseline ? (measured - baseline) : 0;
@@ -166,7 +162,6 @@ static LIBC_INLINE uint64_t throughput_baseline(
166162

167163
cpp::atomic_thread_fence(cpp::MemoryOrder::ACQ_REL);
168164
uint64_t start = gpu::processor_clock();
169-
170165
asm("" ::"llr"(start));
171166

172167
T result{};
@@ -179,11 +174,10 @@ static LIBC_INLINE uint64_t throughput_baseline(
179174
}
180175

181176
uint64_t stop = gpu::processor_clock();
182-
cpp::atomic_thread_fence(cpp::MemoryOrder::ACQ_REL);
183177
asm("" ::"r"(stop));
178+
cpp::atomic_thread_fence(cpp::MemoryOrder::ACQ_REL);
184179

185180
volatile auto output = result;
186-
(void)output;
187181

188182
return stop - start;
189183
}
@@ -200,7 +194,6 @@ static LIBC_INLINE uint64_t throughput(F f, const cpp::array<T, N> &inputs1,
200194

201195
cpp::atomic_thread_fence(cpp::MemoryOrder::ACQ_REL);
202196
uint64_t start = gpu::processor_clock();
203-
204197
asm("" ::"llr"(start));
205198

206199
T result{};
@@ -213,11 +206,10 @@ static LIBC_INLINE uint64_t throughput(F f, const cpp::array<T, N> &inputs1,
213206
}
214207

215208
uint64_t stop = gpu::processor_clock();
216-
cpp::atomic_thread_fence(cpp::MemoryOrder::ACQ_REL);
217209
asm("" ::"r"(stop));
210+
cpp::atomic_thread_fence(cpp::MemoryOrder::ACQ_REL);
218211

219212
volatile auto output = result;
220-
(void)output;
221213

222214
const uint64_t measured = stop - start;
223215
return measured > baseline ? (measured - baseline) : 0;

0 commit comments

Comments
 (0)