Skip to content

Commit 2e78951

Browse files
committed
Honor last occurence of -f[no-]sycl-instrument-device-code
Signed-off-by: Julian Oppermann <[email protected]>
1 parent 970b041 commit 2e78951

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sycl-jit/jit-compiler/lib/rtc/DeviceCompilation.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,15 @@ Error jit_compiler::linkDefaultDeviceLibraries(llvm::Module &Module,
158158

159159
bool DeviceInstrumentationEnabled = true;
160160
for (StringRef UA : UserArgs) {
161+
// Check instrumentation-related flags (last occurence determines outcome).
161162
if (UA == "-fno-sycl-instrument-device-code") {
162163
DeviceInstrumentationEnabled = false;
163164
continue;
164165
}
166+
if (UA == "-fsycl-instrument-device-code") {
167+
DeviceInstrumentationEnabled = true;
168+
continue;
169+
}
165170

166171
// Issue warning for `-fsycl-device-lib` or `-fno-sycl-device-lib`.
167172
// TODO: Is it worth supporting these flags? We're using `LinkOnlyNeeded`

0 commit comments

Comments
 (0)