@@ -28,39 +28,6 @@ limitations under the License.
2828namespace tflite {
2929namespace gpu {
3030namespace cl {
31- namespace {
32- std::string GetReadImageFromDataType (DataType data_type) {
33- if (data_type == DataType::FLOAT32 ) {
34- return " read_imagef" ;
35- } else if (data_type == DataType::FLOAT16 ) {
36- return " read_imageh" ;
37- } else {
38- return " error" ;
39- }
40- }
41-
42- std::string GetWriteImageFromDataType (DataType data_type) {
43- if (data_type == DataType::FLOAT32 ) {
44- return " write_imagef" ;
45- } else if (data_type == DataType::FLOAT16 ) {
46- return " write_imageh" ;
47- } else {
48- return " error" ;
49- }
50- }
51-
52- std::string GetImageModifier (AccessType access) {
53- switch (access) {
54- case AccessType::READ :
55- return " __read_only" ;
56- case AccessType::WRITE :
57- return " __write_only" ;
58- case AccessType::READ_WRITE :
59- return " __read_write" ;
60- }
61- }
62-
63- } // namespace
6431
6532std::string GetCommonDefines (CalculationsPrecision precision) {
6633 std::string result;
@@ -76,8 +43,6 @@ std::string GetCommonDefines(CalculationsPrecision precision) {
7643 result += " #define TO_FLT4 convert_float4\n " ;
7744 result += " #define TO_ACCUM_TYPE convert_float4\n " ;
7845 result += " #define TO_ACCUM_FLT convert_float\n " ;
79- result += " #define READ_IMAGE read_imagef\n " ;
80- result += " #define WRITE_IMAGE write_imagef\n " ;
8146 break ;
8247 case CalculationsPrecision::F16 :
8348 result += " #pragma OPENCL EXTENSION cl_khr_3d_image_writes : enable\n " ;
@@ -90,8 +55,6 @@ std::string GetCommonDefines(CalculationsPrecision precision) {
9055 result += " #define TO_FLT4 convert_half4\n " ;
9156 result += " #define TO_ACCUM_TYPE convert_half4\n " ;
9257 result += " #define TO_ACCUM_FLT convert_half\n " ;
93- result += " #define READ_IMAGE read_imageh\n " ;
94- result += " #define WRITE_IMAGE write_imageh\n " ;
9558 break ;
9659 case CalculationsPrecision::F32_F16 :
9760 result += " #pragma OPENCL EXTENSION cl_khr_3d_image_writes : enable\n " ;
@@ -104,8 +67,6 @@ std::string GetCommonDefines(CalculationsPrecision precision) {
10467 result += " #define TO_FLT4 convert_half4\n " ;
10568 result += " #define TO_ACCUM_TYPE convert_float4\n " ;
10669 result += " #define TO_ACCUM_FLT convert_float\n " ;
107- result += " #define READ_IMAGE read_imageh\n " ;
108- result += " #define WRITE_IMAGE write_imageh\n " ;
10970 break ;
11071 }
11172
0 commit comments