Skip to content
This repository was archived by the owner on May 9, 2024. It is now read-only.

Commit d1ec6a4

Browse files
committed
Enable variable-steps tests
1 parent f01cc56 commit d1ec6a4

File tree

3 files changed

+14
-20
lines changed

3 files changed

+14
-20
lines changed

omniscidb/QueryEngine/Compiler/genx.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,8 @@ int32_t atomicSum32SkipVal(GENERIC_ADDR_SPACE int32_t* addr,
187187
int64_t atomicSum64SkipVal(GENERIC_ADDR_SPACE int64_t* addr,
188188
const int64_t val,
189189
const int64_t skip_val) {
190-
int32_t old = atomic_xchg_int_64(addr, 0);
191-
int32_t old2 = agg_sum_shared(addr, old == skip_val ? val : (val + old));
190+
int64_t old = atomic_xchg_int_64(addr, 0);
191+
int64_t old2 = agg_sum_shared(addr, old == skip_val ? val : (val + old));
192192
return old == skip_val ? old2 : (old2 + old);
193193
}
194194

@@ -212,6 +212,16 @@ int64_t agg_sum_int64_skip_val_shared(GENERIC_ADDR_SPACE int64_t* agg,
212212
return 0;
213213
}
214214

215+
int64_t agg_sum_skip_val_shared(GENERIC_ADDR_SPACE int64_t* agg,
216+
const int64_t val,
217+
const int64_t skip_val) {
218+
if (val != skip_val) {
219+
const int64_t old = atomicSum64SkipVal(agg, val, skip_val);
220+
return old;
221+
}
222+
return 0;
223+
}
224+
215225
void agg_max_int32_skip_val_shared(GENERIC_ADDR_SPACE int32_t* agg,
216226
const int32_t val,
217227
const int32_t skip_val) {

omniscidb/QueryEngine/Compiler/genx.ll

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -167,20 +167,6 @@ define void @agg_sum_double_skip_val_shared(i64 addrspace(4)* %agg, double nound
167167
ret void
168168
}
169169

170-
define i64 @agg_sum_skip_val_shared(i64 addrspace(4)* %agg, i64 noundef %val, i64 noundef %skip_val) {
171-
%no_skip = icmp ne i64 %val, %skip_val
172-
br i1 %no_skip, label %.noskip, label %.skip
173-
.noskip:
174-
%old = atomicrmw xchg i64 addrspace(4)* %agg, i64 0 monotonic
175-
%isempty = icmp eq i64 %old, -9223372036854775808
176-
%sel = select i1 %isempty, i64 0, i64 %old
177-
%new_val = add nsw i64 %val, %sel
178-
%old2 = atomicrmw add i64 addrspace(4)* %agg, i64 %new_val monotonic
179-
ret i64 %old2
180-
.skip:
181-
ret i64 0
182-
}
183-
184170
define void @atomic_or(i32 addrspace(4)* %addr, i32 noundef %val) {
185171
.entry:
186172
%orig = load atomic i32, i32 addrspace(4)* %addr unordered, align 8

omniscidb/Tests/L0SharedMemoryTest.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -368,13 +368,12 @@ TEST(SingleColumn, VariableSteps_FixedEntries_2) {
368368
}
369369

370370
TEST(SingleColumn, VariableSteps_FixedEntries_3) {
371-
GTEST_SKIP();
372371
TestInputData input;
373372
input.setDeviceId(0)
374373
.setNumInputBuffers(4)
375374
.setAggWidth(8)
376375
.setMinEntry(0)
377-
.setMaxEntry(367)
376+
.setMaxEntry(204)
378377
.setKeylessHash(true)
379378
.setTargetIndexForKey(0)
380379
.setTargetInfos(generate_custom_agg_target_infos(
@@ -394,13 +393,12 @@ TEST(SingleColumn, VariableSteps_FixedEntries_3) {
394393
}
395394

396395
TEST(SingleColumn, VariableSteps_FixedEntries_4) {
397-
GTEST_SKIP();
398396
TestInputData input;
399397
input.setDeviceId(0)
400398
.setNumInputBuffers(4)
401399
.setAggWidth(8)
402400
.setMinEntry(0)
403-
.setMaxEntry(517)
401+
.setMaxEntry(255)
404402
.setKeylessHash(true)
405403
.setTargetIndexForKey(0)
406404
.setTargetInfos(generate_custom_agg_target_infos(

0 commit comments

Comments
 (0)