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:
Hoppe, Mateusz
2018-03-06 15:33:34 +01:00
committed by sys_ocldev
parent 0afd7a9ec1
commit cfa9cd8040
3 changed files with 24 additions and 0 deletions

View File

@@ -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";
}
}

View File

@@ -31,6 +31,8 @@ class Device;
enum class SipKernelType : std::uint32_t {
Csr = 0,
DbgCsr,
DbgCsrLocal,
COUNT
};

View File

@@ -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);
}