1
1
/*
2
- * Copyright (c) 2017, Intel Corporation
2
+ * Copyright (c) 2017 - 2018 , Intel Corporation
3
3
*
4
4
* Permission is hereby granted, free of charge, to any person obtaining a
5
5
* copy of this software and associated documentation files (the "Software"),
@@ -63,6 +63,8 @@ class PrintFormatter {
63
63
protected:
64
64
void printString (const char *formatString, const std::function<void (char *)> &print);
65
65
size_t printToken (char *output, size_t size, const char *formatString);
66
+ size_t printStringToken (char *output, size_t size, const char *formatString);
67
+ size_t printPointerToken (char *output, size_t size, const char *formatString);
66
68
67
69
char escapeChar (char escape);
68
70
bool isConversionSpecifier (char c);
@@ -108,8 +110,9 @@ class PrintFormatter {
108
110
for (int i = 0 ; i < valueCount; i++) {
109
111
read (&value);
110
112
charactersPrinted += simple_sprintf (output + charactersPrinted, size - charactersPrinted, strippedFormat, value);
111
- if (i < valueCount - 1 )
113
+ if (i < valueCount - 1 ) {
112
114
charactersPrinted += simple_sprintf (output + charactersPrinted, size - charactersPrinted, " %c" , ' ,' );
115
+ }
113
116
}
114
117
115
118
if (sizeof (T) < 4 ) {
@@ -119,23 +122,11 @@ class PrintFormatter {
119
122
return charactersPrinted;
120
123
}
121
124
122
- size_t printStringToken (char *output, size_t size, const char *formatString) {
123
- int index = 0 ;
124
- int type = 0 ;
125
- // additional read to discard the data type
126
- read (&type);
127
- read (&index);
128
- if (type == static_cast <int >(PRINTF_DATA_TYPE::STRING))
129
- return simple_sprintf (output, size, formatString, kernel.getKernelInfo ().queryPrintfString (index));
130
- else
131
- return simple_sprintf (output, size, formatString, 0 );
132
- }
133
-
134
125
Kernel &kernel;
135
126
GraphicsAllocation &data;
136
127
137
128
uint8_t *buffer; // buffer extracted from the kernel, contains values to be printed
138
129
uint32_t bufferSize; // size of the data contained in the buffer
139
130
uint32_t offset; // current position in currently parsed buffer
140
131
};
141
- };
132
+ }; // namespace OCLRT
0 commit comments