11/*
2- * Copyright (c) 2017, Intel Corporation
2+ * Copyright (c) 2017 - 2018 , Intel Corporation
33 *
44 * Permission is hereby granted, free of charge, to any person obtaining a
55 * copy of this software and associated documentation files (the "Software"),
@@ -63,6 +63,8 @@ class PrintFormatter {
6363 protected:
6464 void printString (const char *formatString, const std::function<void (char *)> &print);
6565 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);
6668
6769 char escapeChar (char escape);
6870 bool isConversionSpecifier (char c);
@@ -108,8 +110,9 @@ class PrintFormatter {
108110 for (int i = 0 ; i < valueCount; i++) {
109111 read (&value);
110112 charactersPrinted += simple_sprintf (output + charactersPrinted, size - charactersPrinted, strippedFormat, value);
111- if (i < valueCount - 1 )
113+ if (i < valueCount - 1 ) {
112114 charactersPrinted += simple_sprintf (output + charactersPrinted, size - charactersPrinted, " %c" , ' ,' );
115+ }
113116 }
114117
115118 if (sizeof (T) < 4 ) {
@@ -119,23 +122,11 @@ class PrintFormatter {
119122 return charactersPrinted;
120123 }
121124
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-
134125 Kernel &kernel;
135126 GraphicsAllocation &data;
136127
137128 uint8_t *buffer; // buffer extracted from the kernel, contains values to be printed
138129 uint32_t bufferSize; // size of the data contained in the buffer
139130 uint32_t offset; // current position in currently parsed buffer
140131};
141- };
132+ }; // namespace OCLRT
0 commit comments