Skip to content

Commit 1dd699b

Browse files
authored
[PTI-LIB] Add g++ compiler to Nightly Build
Add g++ compiler to nightly build to catch extra warnings or errors not found by clang or icpx. This configuration includes the optimization level to avoid occasional build errors with `FORTIFY_SOURCE`, it issues a warning if optimizations are turned on. Add warning for extra semi-colons. Remove cast in test now that we have a function capable of printing. Signed-off-by: Schilling, Matthew <matthew.schilling@intel.com>
1 parent db99d6d commit 1dd699b

File tree

10 files changed

+50
-18
lines changed

10 files changed

+50
-18
lines changed

.github/workflows/nightly_build_and_test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ jobs:
5858
- container: ${{ vars.PTI_DOCKER_ROCKY_8_ONEAPI_25_0_0 }}
5959
uploadname: "rocky-8.2025.0.0"
6060
preset: linux-icpx-release
61-
61+
- container: ${{ vars.PTI_DOCKER_ROCKY_8_ONEAPI_25_0_0 }}
62+
uploadname: "rocky-8.gxx.2025.0.0"
63+
preset: linux-gxx-release
6264

6365
container:
6466
image: ${{ matrix.container }}

sdk/CMakePresets.json

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"cacheVariables": {
1111
"CMAKE_BUILD_TYPE": "Release",
1212
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/cmake/toolchains/icpx_toolchain.cmake",
13-
"CMAKE_CXX_FLAGS": "-Wall -Wextra -Wformat -Werror -Wformat-security -Werror=format-security -fstack-protector-strong -D_FORTIFY_SOURCE=2",
14-
"CMAKE_C_FLAGS": "-Wall -Wextra -Wformat -Werror -Wformat-security -Werror=format-security -fstack-protector-strong -D_FORTIFY_SOURCE=2",
13+
"CMAKE_CXX_FLAGS": "-Wall -Wextra -Wextra-semi -Wformat -Werror -Wformat-security -Werror=format-security -fstack-protector-strong -D_FORTIFY_SOURCE=2",
14+
"CMAKE_C_FLAGS": "-Wall -Wextra -Wextra-semi -Wformat -Werror -Wformat-security -Werror=format-security -fstack-protector-strong -D_FORTIFY_SOURCE=2",
1515
"CMAKE_SHARED_LINKER_FLAGS": "-Wl,-z,relro,-z,now,-z,noexecstack",
1616
"CMAKE_EXE_LINKER_FLAGS": "-Wl,-z,relro,-z,now,-z,noexecstack"
1717
}
@@ -25,8 +25,8 @@
2525
"cacheVariables": {
2626
"CMAKE_BUILD_TYPE": "Release",
2727
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/cmake/toolchains/icpx_toolchain.cmake",
28-
"CMAKE_CXX_FLAGS": "-Wall -Wextra -Wformat -Werror -Wformat-security -Werror=format-security -g -fstack-protector-strong -D_FORTIFY_SOURCE=2",
29-
"CMAKE_C_FLAGS": "-Wall -Wextra -Wformat -Werror -Wformat-security -Werror=format-security -g -fstack-protector-strong -D_FORTIFY_SOURCE=2",
28+
"CMAKE_CXX_FLAGS": "-Wall -Wextra -Wextra-semi -Wformat -Werror -Wformat-security -Werror=format-security -g -fstack-protector-strong -D_FORTIFY_SOURCE=2",
29+
"CMAKE_C_FLAGS": "-Wall -Wextra -Wextra-semi -Wformat -Werror -Wformat-security -Werror=format-security -g -fstack-protector-strong -D_FORTIFY_SOURCE=2",
3030
"CMAKE_SHARED_LINKER_FLAGS": "-Wl,-z,relro,-z,now,-z,noexecstack",
3131
"CMAKE_EXE_LINKER_FLAGS": "-Wl,-z,relro,-z,now,-z,noexecstack"
3232
}
@@ -41,8 +41,8 @@
4141
"cacheVariables": {
4242
"CMAKE_BUILD_TYPE": "Debug",
4343
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/cmake/toolchains/icpx_toolchain.cmake",
44-
"CMAKE_CXX_FLAGS": "-Wall -Wextra -Wformat -Wformat-security -fno-omit-frame-pointer -fno-optimize-sibling-calls",
45-
"CMAKE_C_FLAGS": "-Wall -Wextra -Wformat -Wformat-security -fno-omit-frame-pointer -fno-optimize-sibling-calls",
44+
"CMAKE_CXX_FLAGS": "-Wall -Wextra -Wextra-semi -Wformat -Wformat-security -fno-omit-frame-pointer -fno-optimize-sibling-calls",
45+
"CMAKE_C_FLAGS": "-Wall -Wextra -Wextra-semi -Wformat -Wformat-security -fno-omit-frame-pointer -fno-optimize-sibling-calls",
4646
"PTI_ENABLE_LOGGING": "ON"
4747
}
4848
},
@@ -135,6 +135,22 @@
135135
"PTI_ENABLE_LOGGING": "ON"
136136
}
137137
},
138+
{
139+
"name": "linux-gxx-release",
140+
"displayName": "Linux Release x64 GCC Ninja Config",
141+
"description": "Linux Release x64 Config using Ninja generator and gcc/g++ compiler",
142+
"generator": "Ninja",
143+
"binaryDir": "${sourceDir}/build-${presetName}",
144+
"cacheVariables": {
145+
"CMAKE_BUILD_TYPE": "Release",
146+
"CMAKE_C_COMPILER": "gcc",
147+
"CMAKE_CXX_COMPILER": "g++",
148+
"CMAKE_CXX_FLAGS": "-Wall -Wextra -Wextra-semi -Wformat -Werror -Wformat-security -Werror=format-security -fstack-protector-strong -O3 -D_FORTIFY_SOURCE=2",
149+
"CMAKE_C_FLAGS": "-Wall -Wextra -Wextra-semi -Wformat -Werror -Wformat-security -Werror=format-security -fstack-protector-strong -O3 -D_FORTIFY_SOURCE=2",
150+
"CMAKE_SHARED_LINKER_FLAGS": "-Wl,-z,relro,-z,now,-z,noexecstack",
151+
"CMAKE_EXE_LINKER_FLAGS": "-Wl,-z,relro,-z,now,-z,noexecstack"
152+
}
153+
},
138154
{
139155
"name": "windows-icx-debug",
140156
"displayName": "Windows Debug x64 IntelLLVM Config",
@@ -275,6 +291,11 @@
275291
"configurePreset": "linux-tsan",
276292
"displayName": "Linux ThreadSanitizer Build"
277293
},
294+
{
295+
"name": "linux-gxx-release",
296+
"configurePreset": "linux-gxx-release",
297+
"displayName": "Linux gcc/g++ Build"
298+
},
278299
{
279300
"name": "windows-debug",
280301
"displayName": "Windows Debug x64 MSVC Build",
@@ -384,6 +405,14 @@
384405
"LD_LIBRARY_PATH": "${sourceDir}/build-${presetName}/lib:$penv{LD_LIBRARY_PATH}"
385406
}
386407
},
408+
{
409+
"name": "linux-gxx-release",
410+
"configurePreset": "linux-gxx-release",
411+
"displayName": "Linux gcc/g++ Tests",
412+
"environment": {
413+
"LD_LIBRARY_PATH": "${sourceDir}/build-${presetName}/lib:$penv{LD_LIBRARY_PATH}"
414+
}
415+
},
387416
{
388417
"name": "windows-icx-debug",
389418
"displayName": "Windows Debug x64 IntelLLVM Test",

sdk/samples/iso3dfd_dpcpp/src/utils.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414
bool CheckGridDimension(size_t n1, size_t n2, size_t n3, unsigned int dim_x,
1515
unsigned int dim_y, unsigned int block_z) {
16-
16+
1717
if (0 == dim_x) {
1818
std::cout << " ERROR: Invalid Grid Size: DIMX cannot be Zero\n";
1919
return true;
@@ -26,7 +26,7 @@ bool CheckGridDimension(size_t n1, size_t n2, size_t n3, unsigned int dim_x,
2626
std::cout << " ERROR: Invalid Grid Size: BLOCKZ cannot be Zero\n";
2727
return true;
2828
}
29-
29+
3030
if (n1 % dim_x) {
3131
std::cout << " ERROR: Invalid Grid Size: n1 should be multiple of DIMX - "
3232
<< dim_x << "\n";
@@ -119,7 +119,7 @@ void Usage(const std::string& programName) {
119119
void PrintStats(double time, size_t n1, size_t n2, size_t n3,
120120
unsigned int nIterations) {
121121
float throughput_mpoints = 0.0f, mflops = 0.0f, normalized_time = 0.0f;
122-
double mbytes = 0.0f;
122+
double mbytes = 0.0;
123123

124124
std::cout << "--------------------------------------\n";
125125
if (0 < nIterations) {

sdk/src/levelzero/ze_local_collection_helpers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class A2EventPool {
116116
A2EventPool(A2EventPool&&) = delete;
117117
A2EventPool& operator=(A2EventPool&&) = delete;
118118
A2EventPool() = delete;
119-
A2EventPool(uint32_t events_per_pool) : events_per_pool_count_(events_per_pool){};
119+
A2EventPool(uint32_t events_per_pool) : events_per_pool_count_(events_per_pool) {}
120120
~A2EventPool() {}
121121

122122
ze_event_handle_t GetEvent(const ze_context_handle_t context) {

sdk/src/sycl/sycl_collector.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ class SyclCollector {
348348

349349
private:
350350
explicit SyclCollector(OnSyclRuntimeViewCallback buffer_callback)
351-
: acallback_(buffer_callback), xptiGetStashedKV(GetStashedFuncPtrFromSharedObject()){};
351+
: acallback_(buffer_callback), xptiGetStashedKV(GetStashedFuncPtrFromSharedObject()) {}
352352

353353
int32_t trace_all_env_value = utils::IsSetEnv("PTI_TRACE_ALL_RUNTIME_OPS");
354354
inline static thread_local ZeKernelCommandExecutionRecord sycl_runtime_rec_;

sdk/src/utils/internal_helper.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ bool IsValid(IntType val, EnumVal V) {
1818
static_assert(std::is_enum<EnumVal>::value);
1919
static_assert(std::is_same<EnumType, EnumVal>::value);
2020
return static_cast<IntType>(V) == val;
21-
};
21+
}
2222

2323
template <typename IntType, typename EnumType, typename EnumVal, typename... Next>
2424
bool IsValid(IntType val, EnumVal V, Next... oth) {
2525
static_assert(std::is_enum<EnumVal>::value);
2626
static_assert(std::is_same<EnumType, EnumVal>::value);
2727

2828
return static_cast<IntType>(V) == val || IsValid<IntType, EnumType, Next...>(val, oth...);
29-
};
29+
}
3030

3131
///////////////////////////////////////////////////////////////////////////////
3232
/// @brief Checks is the provided value v belongs to pti_view_kind enums

sdk/test/main_dpcgemm_fixture.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ class MainFixtureTest : public ::testing::TestWithParam<std::tuple<bool, bool, b
197197
last_kernel_timestamp = 0;
198198
user_real_timestamp = 0;
199199
sycl_has_all_records = false;
200-
};
200+
}
201201

202202
void TearDown() override {
203203
// Called right before destructor after each test

sdk/test/main_startstop_fixture.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ static void BufferCompleted(unsigned char *buf, size_t buf_size, size_t valid_bu
242242
}
243243
}
244244
::operator delete(buf);
245-
};
245+
}
246246

247247
template <typename T>
248248
[[maybe_unused]] void InitVectors(std::vector<T> &a, std::vector<T> &b, std::vector<T> &c,

sdk/test/utils/test_helpers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ inline std::vector<unsigned char> CreateEmptyBuffer() {
106106
std::size_t buffer_size = 0;
107107
((buffer_size += (RecordInsert::kNumber * sizeof(typename RecordInsert::Type))), ...);
108108
return std::vector<unsigned char>(buffer_size);
109-
};
109+
}
110110

111111
template <typename... RecordInsert>
112112
inline std::vector<unsigned char> CreateFullBuffer() {

sdk/test/view_gpu_local_test.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <iostream>
44

55
#include "pti/pti_view.h"
6+
#include "utils/test_helpers.h"
67

78
class ViewGPULocalFixtureTest : public ::testing::Test {
89
protected:
@@ -18,7 +19,7 @@ TEST_F(ViewGPULocalFixtureTest, CheckGPULocalViewAvailable) {
1819
EXPECT_TRUE(result == pti_result::PTI_SUCCESS ||
1920
result == pti_result::PTI_ERROR_L0_LOCAL_PROFILING_NOT_SUPPORTED);
2021

21-
std::cout << "result: " << (uint32_t)result << std::endl;
22+
std::cout << "result: " << result << std::endl;
2223

2324
// just exercising two times and verifying the answer is the same
2425
pti_result result2 = ptiViewGPULocalAvailable();

0 commit comments

Comments
 (0)