mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-18 22:08:53 +08:00
Add new debug sip kernel types for kernel debugging support
- new internal options - new builtins sip kernel generation Change-Id: I132c4612f1ae58516f0573e636f9362b961bb427
This commit is contained in:
committed by
sys_ocldev
parent
0afd7a9ec1
commit
cfa9cd8040
@@ -34,6 +34,10 @@ const char *getSipKernelCompilerInternalOptions(SipKernelType kernel) {
|
||||
return "";
|
||||
case SipKernelType::Csr:
|
||||
return "-cl-include-sip-csr";
|
||||
case SipKernelType::DbgCsr:
|
||||
return "-cl-include-sip-kernel-debug -cl-include-sip-csr -cl-set-bti:0";
|
||||
case SipKernelType::DbgCsrLocal:
|
||||
return "-cl-include-sip-kernel-local-debug -cl-include-sip-csr -cl-set-bti:0";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,8 @@ class Device;
|
||||
|
||||
enum class SipKernelType : std::uint32_t {
|
||||
Csr = 0,
|
||||
DbgCsr,
|
||||
DbgCsrLocal,
|
||||
COUNT
|
||||
};
|
||||
|
||||
|
||||
@@ -84,6 +84,24 @@ TEST(Sip, getType) {
|
||||
SipKernel csr{SipKernelType::Csr, &binary, sizeof(binary)};
|
||||
EXPECT_EQ(SipKernelType::Csr, csr.getType());
|
||||
|
||||
SipKernel dbgCsr{SipKernelType::DbgCsr, &binary, sizeof(binary)};
|
||||
EXPECT_EQ(SipKernelType::DbgCsr, dbgCsr.getType());
|
||||
|
||||
SipKernel dbgCsrLocal{SipKernelType::DbgCsrLocal, &binary, sizeof(binary)};
|
||||
EXPECT_EQ(SipKernelType::DbgCsrLocal, dbgCsrLocal.getType());
|
||||
|
||||
SipKernel undefined{SipKernelType::COUNT, &binary, sizeof(binary)};
|
||||
EXPECT_EQ(SipKernelType::COUNT, undefined.getType());
|
||||
}
|
||||
|
||||
TEST(DebugSip, WhenRequestingDbgCsrSipKernelThenProperCompilerInternalOptionsAreReturned) {
|
||||
const char *opt = getSipKernelCompilerInternalOptions(SipKernelType::DbgCsr);
|
||||
ASSERT_NE(nullptr, opt);
|
||||
EXPECT_STREQ("-cl-include-sip-kernel-debug -cl-include-sip-csr -cl-set-bti:0", opt);
|
||||
}
|
||||
|
||||
TEST(DebugSip, WhenRequestingDbgCsrWithLocalMemorySipKernelThenProperCompilerInternalOptionsAreReturned) {
|
||||
const char *opt = getSipKernelCompilerInternalOptions(SipKernelType::DbgCsrLocal);
|
||||
ASSERT_NE(nullptr, opt);
|
||||
EXPECT_STREQ("-cl-include-sip-kernel-local-debug -cl-include-sip-csr -cl-set-bti:0", opt);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user