Skip to content

Commit 2f3415e

Browse files
authored
Add cmake presets for clang (#915)
* Add cmake presets for clang * Add [[maybe_unused]] to unused vars * Look for xpti package in clang's installation dir
1 parent 98ec45b commit 2f3415e

5 files changed

Lines changed: 43 additions & 12 deletions

File tree

sdk/CMakePresets.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,11 @@
296296
"configurePreset": "linux-icpx-release",
297297
"displayName": "Linux Release x64 IntelLLVM Ninja Build"
298298
},
299+
{
300+
"name": "linux-clang-release",
301+
"configurePreset": "linux-clang-release",
302+
"displayName": "Linux Release x64 Clang Ninja Build"
303+
},
299304
{
300305
"name": "linux-icpx-reldebuginfo",
301306
"configurePreset": "linux-icpx-reldebuginfo",
@@ -306,6 +311,11 @@
306311
"configurePreset": "linux-icpx-debug",
307312
"displayName": "Linux Debug x64 IntelLLVM Ninja Build"
308313
},
314+
{
315+
"name": "linux-clang-debug",
316+
"configurePreset": "linux-clang-debug",
317+
"displayName": "Linux Debug x64 Clang Ninja Build"
318+
},
309319
{
310320
"name": "linux-cov",
311321
"configurePreset": "linux-cov",
@@ -401,6 +411,14 @@
401411
"LD_LIBRARY_PATH": "${sourceDir}/build-${presetName}/lib:$penv{LD_LIBRARY_PATH}"
402412
}
403413
},
414+
{
415+
"name": "linux-clang-release",
416+
"configurePreset": "linux-clang-release",
417+
"displayName": "Linux Release x64 Clang Tests",
418+
"environment": {
419+
"LD_LIBRARY_PATH": "${sourceDir}/build-${presetName}/lib:$penv{LD_LIBRARY_PATH}"
420+
}
421+
},
404422
{
405423
"name": "linux-icpx-reldebuginfo",
406424
"configurePreset": "linux-icpx-reldebuginfo",
@@ -417,6 +435,14 @@
417435
"LD_LIBRARY_PATH": "${sourceDir}/build-${presetName}/lib:$penv{LD_LIBRARY_PATH}"
418436
}
419437
},
438+
{
439+
"name": "linux-clang-debug",
440+
"configurePreset": "linux-clang-debug",
441+
"displayName": "Linux Debug x64 Clang Tests",
442+
"environment": {
443+
"LD_LIBRARY_PATH": "${sourceDir}/build-${presetName}/lib:$penv{LD_LIBRARY_PATH}"
444+
}
445+
},
420446
{
421447
"name": "linux-cov",
422448
"configurePreset": "linux-cov",
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
set(CMAKE_C_COMPILER "clang")
22
set(CMAKE_CXX_COMPILER "clang++")
3+
4+
find_program(CLANGXX_PATH NAMES clang++)
5+
get_filename_component(_bin_dir ${CLANGXX_PATH} DIRECTORY)
6+
get_filename_component(_prefix "${_bin_dir}" DIRECTORY)
7+
list(PREPEND CMAKE_PREFIX_PATH "${_prefix}")

sdk/test/main_dpcgemm_fixture.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ uint64_t memory_bytes_copied = 0;
5656
uint64_t memory_view_record_count = 0;
5757
uint64_t kernel_view_record_count = 0;
5858
bool kernel_uuid_zero = true;
59-
uint64_t kernel_has_sycl_file_count = 0;
59+
[[maybe_unused]] uint64_t kernel_has_sycl_file_count = 0;
6060
uint64_t masked_by_last_id_records = 0;
6161
uint64_t last_pop_eid = 0;
6262
uint64_t last_id_records = 0;
63-
double perf_time_with_tracing = 0;
64-
double perf_time_without_tracing = 0;
65-
double perf_time = 0;
63+
[[maybe_unused]] double perf_time_with_tracing = 0;
64+
[[maybe_unused]] double perf_time_without_tracing = 0;
65+
[[maybe_unused]] double perf_time = 0;
6666
uint64_t num_of_overhead_recs = 0;
6767
bool overhead_kind_stringified = false;
6868
uint64_t num_of_overhead_counts = 0;

sdk/test/main_startstop_fixture.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ constexpr size_t kNumElementsForCorrIds = 3;
4747
constexpr uint64_t kMinKernelDurationNs = 100;
4848
constexpr uint64_t kExternalCorrelationIdBase = 11;
4949

50-
bool matched_sq_corr_ids = false;
51-
bool matched_add_corr_ids = false;
50+
[[maybe_unused]] bool matched_sq_corr_ids = false;
51+
[[maybe_unused]] bool matched_add_corr_ids = false;
5252
bool timestamps_nonzero_duration = true;
5353
bool kernel_timestamps_monotonic = false;
5454
uint64_t sycl_kernel_corr_id[kNumElementsForCorrIds];
@@ -57,11 +57,11 @@ uint64_t kernel_corr_id[kNumElementsForCorrIds];
5757
uint64_t kernel_append_time[kNumElementsForCorrIds];
5858
uint64_t sycl_idx = 0;
5959
uint64_t kernel_idx = 0;
60-
uint64_t kernel_start_ts = 0;
61-
uint64_t kernel_stop_ts = 0;
60+
[[maybe_unused]] uint64_t kernel_start_ts = 0;
61+
[[maybe_unused]] uint64_t kernel_stop_ts = 0;
6262
uint64_t number_of_kernel_recs = 0;
6363
uint64_t number_of_sycl_recs = 0;
64-
uint64_t expected_sycl_recs = 0;
64+
[[maybe_unused]] uint64_t expected_sycl_recs = 0;
6565
uint64_t eid = kExternalCorrelationIdBase;
6666

6767
// sync variables

sdk/test/main_zegemm_fixture.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ bool buffer_size_atleast_largest_record = false;
5656
bool ze_initialization_succeeded = false;
5757
bool capture_records = false;
5858
bool special_record_seen = false;
59-
bool synchronization_record_seen = false;
59+
[[maybe_unused]] bool synchronization_record_seen = false;
6060
bool synchronization_record_barrier_exec_seen = false;
6161
bool synchronization_record_barrier_mem_seen = false;
6262
bool synchronization_record_fence_exec_seen = false;
@@ -82,7 +82,7 @@ const char* barrier_exec_api_name = nullptr;
8282
const char* barrier_mem_ranges_api_name = nullptr;
8383
const char* fence_api_name = nullptr;
8484
uint32_t synch_input_event_number = 0;
85-
uint32_t synchronization_record_number = 0;
85+
[[maybe_unused]] uint32_t synchronization_record_number = 0;
8686
bool sycl_runtime_launch_seen = false;
8787
bool zecall_record_seen = false;
8888
bool external_corrid_special_record_seen = false;
@@ -94,7 +94,7 @@ std::vector<pti_view_record_memory_copy> copy_records;
9494
std::vector<pti_view_record_kernel> kernel_records;
9595
ze_device_uuid_t device_uuid = {};
9696
ze_context_handle_t context_test = nullptr;
97-
ze_device_handle_t device_test = nullptr;
97+
[[maybe_unused]] ze_device_handle_t device_test = nullptr;
9898
ze_command_queue_handle_t queue_test_kernel = nullptr;
9999
ze_command_queue_handle_t queue_test_mem_copy = nullptr;
100100

0 commit comments

Comments
 (0)