Skip to content

Commit

Permalink
Add codegen example testing workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
omarahmed1111 committed Sep 21, 2023
1 parent d45c24f commit b418b8d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ jobs:
-DUR_BUILD_ADAPTER_${{matrix.adapter.name}}=ON
-DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++
-DUR_CONFORMANCE_TARGET_TRIPLES=${{matrix.adapter.triplet}}
-DUR_BUILD_EXAMPLE_CODEGEN=ON
- name: Build
# This is so that device binaries can find the sycl runtime library
Expand All @@ -194,6 +195,11 @@ jobs:
working-directory: ${{github.workspace}}/build
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "conformance" --timeout 180

- name: Test codegen example
if: matrix.adapter.name == 'L0'
working-directory: ${{github.workspace}}/build
run: bin/codegen

windows-build:
name: Build - Windows
strategy:
Expand Down
3 changes: 1 addition & 2 deletions examples/codegen/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ std::vector<ur_adapter_handle_t> get_adapters() {
std::vector<ur_adapter_handle_t>
get_supported_adapters(std::vector<ur_adapter_handle_t> &adapters) {
std::vector<ur_adapter_handle_t> supported_adapters;
size_t size = 0;
for (auto adapter : adapters) {
ur_adapter_backend_t backend;
ur_check(urAdapterGetInfo(adapter, UR_ADAPTER_INFO_BACKEND,
Expand Down Expand Up @@ -173,5 +172,5 @@ int main() {
std::cout << "Results are incorrect." << std::endl;
}

return urTearDown(nullptr) == UR_RESULT_SUCCESS ? 0 : 1;
return urTearDown(nullptr) == UR_RESULT_SUCCESS && expectedResult ? 0 : 1;
}

0 comments on commit b418b8d

Please sign in to comment.