Skip to content
This repository was archived by the owner on May 9, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 5 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
2 changes: 2 additions & 0 deletions omniscidb/QueryEngine/Compiler/Backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,4 +234,6 @@ void setSharedMemory(ExecutorDeviceType dt,
GPUTarget& gpu_target,
const std::shared_ptr<compiler::Backend>& backend);

void replace_function(llvm::Module* from, llvm::Module* to, const std::string& fname);

} // namespace compiler
9 changes: 7 additions & 2 deletions omniscidb/QueryEngine/GpuSharedMemoryUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,12 @@ llvm::Value* codegen_smem_dest_slot_ptr(llvm::LLVMContext& context,
auto ptr_type = [&context, &traits](const size_t slot_bytes,
const hdk::ir::Type* type) {
if (slot_bytes == sizeof(int32_t)) {
return traits.smemPointerType(llvm::Type::getInt32Ty(context));
// return traits.smemPointerType(llvm::Type::getInt32Ty(context)); // quickfix
return llvm::Type::getInt32PtrTy(context, /*address_space=*/3);
} else {
CHECK(slot_bytes == sizeof(int64_t));
return traits.smemPointerType(llvm::Type::getInt64Ty(context));
// return traits.smemPointerType(llvm::Type::getInt64Ty(context)); // quickfix
return llvm::Type::getInt64PtrTy(context, /*address_space=*/3);
}
UNREACHABLE() << "Invalid slot size encountered: " << std::to_string(slot_bytes);
return traits.smemPointerType(llvm::Type::getInt32Ty(context));
Expand Down Expand Up @@ -327,6 +329,9 @@ void GpuSharedMemCodeBuilder::codegenInitialization() {
dest_byte_stream,
byte_offset_ll);

// DUMP(traits_, "output_traits_")
// std::cout << "traits_" << traits_;

llvm::Value* init_value_ll = nullptr;
if (slot_size == sizeof(int32_t)) {
init_value_ll =
Expand Down
13 changes: 13 additions & 0 deletions omniscidb/Tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ endif()
add_executable(StringDictionaryBenchmark StringDictionaryBenchmark.cpp)

if(ENABLE_L0)
add_executable(GpuSharedMemoryTestIntel GpuSharedMemoryTestIntel.cpp ResultSetTestUtils.cpp)
add_executable(L0MgrExecuteTest L0MgrExecuteTest.cpp)
add_executable(SpirvBuildTest SpirvBuildTest.cpp)
add_executable(DataMgrWithL0Test DataMgrWithL0Test.cpp)
Expand All @@ -69,11 +70,13 @@ if(ENABLE_L0)
target_link_libraries(SpirvBuildTest gtest ${llvm_libs})
target_link_libraries(DataMgrWithL0Test DataMgr gtest)
target_link_libraries(IntelGPUEnablingTest gtest QueryEngine ArrowQueryRunner)
target_link_libraries(GpuSharedMemoryTestIntel gtest QueryEngine ArrowQueryRunner)

add_test(L0MgrExecuteTest L0MgrExecuteTest ${TEST_ARGS})
add_test(SpirvBuildTest SpirvBuildTest ${TEST_ARGS})
add_test(DataMgrWithL0Test DataMgrWithL0Test ${TEST_ARGS})
add_test(IntelGPUEnablingTest IntelGPUEnablingTest ${TEST_ARGS})
add_test(GpuSharedMemoryTestIntel GpuSharedMemoryTestIntel ${TEST_ARGS})
endif()

add_executable(CostModelTest CostModel/CostModelTest.cpp)
Expand Down Expand Up @@ -134,6 +137,10 @@ else()
target_link_libraries(StringDictionaryBenchmark benchmark gtest StringDictionary Logger Utils $<$<AND:$<CXX_COMPILER_ID:GNU>,$<VERSION_LESS:$<CXX_COMPILER_VERSION>,9.0>>:stdc++fs> ${CMAKE_DL_LIBS} ${Boost_LIBRARIES} ${ZLIB_LIBRARIES})
endif()

if(ENABLE_L0)
target_link_libraries(GpuSharedMemoryTestIntel gtest Logger QueryEngine)
endif()

if(ENABLE_CUDA)
target_link_libraries(GpuSharedMemoryTest gtest Logger QueryEngine)
endif()
Expand Down Expand Up @@ -180,6 +187,7 @@ if(ENABLE_CUDA)
add_test(GpuSharedMemoryTest GpuSharedMemoryTest ${TEST_ARGS})
endif()
if(ENABLE_L0)
add_test(GpuSharedMemoryTestIntel GpuSharedMemoryTestIntel ${TEST_ARGS})
add_test(NAME PuntToCpu COMMAND ArrowBasedExecuteTest "--gtest_filter=Select.Punt*" ${TEST_ARGS})
set_tests_properties(PuntToCpu PROPERTIES LABELS "enabling")
add_test(NAME StreamingTopNFallback COMMAND ArrowBasedExecuteTest "--gtest_filter=Select.TopKHeap:Select.TimeInterval:Select.OverflowAndUnderFlow" ${TEST_ARGS})
Expand Down Expand Up @@ -236,6 +244,10 @@ if(ENABLE_CUDA)
list(APPEND TEST_PROGRAMS GpuSharedMemoryTest)
endif()

if(ENABLE_L0)
list(APPEND TEST_PROGRAMS GpuSharedMemoryTestIntel)
endif()

#if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
# list(APPEND TEST_PROGRAMS UdfTest)
#endif()
Expand Down Expand Up @@ -323,6 +335,7 @@ add_custom_target(topk_tests

if(ENABLE_L0)
set(ENABLING_TESTS
GpuSharedMemoryTestIntel
ArrowStorageSqlTest # taxi queries
SpirvBuildTest
L0MgrExecuteTest
Expand Down
Loading