Contributor: Junyan He <[email protected]>
Signed-off-by: Yan Wang <[email protected]>
---
backend/src/ir/printf.hpp | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/backend/src/ir/printf.hpp b/backend/src/ir/printf.hpp
index def6331..6b2b741 100644
--- a/backend/src/ir/printf.hpp
+++ b/backend/src/ir/printf.hpp
@@ -144,6 +144,31 @@ namespace gbe
}
};
+ struct PrintfLog {
+ uint32_t magic; // 0xAABBCCDD as magic for ASSERT.
+ uint32_t size; // Size of this printf log, include header.
+ uint32_t statementNum; // which printf within one kernel.
+ const char* content;
+
+ PrintfLog(const char* p) {
+ GBE_ASSERT(*((uint32_t *)p) == 0xAABBCCDD);
+ magic = *((uint32_t *)p);
+ p += sizeof(uint32_t);
+ size = *((uint32_t *)p);
+ p += sizeof(uint32_t);
+ statementNum = *((uint32_t *)p);
+ p += sizeof(uint32_t);
+ content = p;
+ }
+
+ template <typename T>
+ T getData(void) {
+ T D = *((T *)content);
+ content += sizeof(T);
+ return D;
+ }
+ };
+
class Context;
class PrintfSet //: public Serializable
--
2.4.3
_______________________________________________
Beignet mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/beignet