Skip to content

Commit 0f0e85d

Browse files
rosergtensorflower-gardener
authored andcommitted
Removed unused code.
PiperOrigin-RevId: 322819694 Change-Id: I1884a4c3af356f34ecefa5249079a8cff1f65b80
1 parent 84dcaf3 commit 0f0e85d

3 files changed

Lines changed: 0 additions & 59 deletions

File tree

‎tensorflow/lite/delegates/gpu/cl/kernels/util.cc‎

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -28,39 +28,6 @@ limitations under the License.
2828
namespace tflite {
2929
namespace gpu {
3030
namespace 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

6532
std::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

‎tensorflow/lite/delegates/gpu/cl/linear_storage.cc‎

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -111,23 +111,6 @@ LinearStorage& LinearStorage::operator=(LinearStorage&& storage) {
111111
return *this;
112112
}
113113

114-
std::string LinearStorage::ReadLinearFLT4(const std::string& z_coord) const {
115-
if (storage_type_ == LinearStorageType::BUFFER) {
116-
return absl::StrCat(name_, "[", z_coord, "]");
117-
} else {
118-
return absl::StrCat("READ_IMAGE(", name_, ", smp_none, (int2)(", z_coord,
119-
", 0))");
120-
}
121-
}
122-
123-
std::string LinearStorage::GetDeclaration() const {
124-
if (storage_type_ == LinearStorageType::BUFFER) {
125-
return absl::StrCat("__global FLT4* ", name_);
126-
} else {
127-
return absl::StrCat("__read_only image2d_t ", name_);
128-
}
129-
}
130-
131114
absl::Status LinearStorage::GetGPUResources(
132115
const GPUObjectDescriptor* obj_ptr,
133116
GPUResourcesWithValue* resources) const {

‎tensorflow/lite/delegates/gpu/cl/linear_storage.h‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,6 @@ class LinearStorage : public GPUObject {
7575
LinearStorage& operator=(const LinearStorage&) = delete;
7676

7777
void SetName(const std::string& name) { name_ = name; }
78-
cl_mem GetMemoryPtr() const { return memory_; }
79-
std::string ReadLinearFLT4(const std::string& z_coord) const;
80-
std::string GetDeclaration() const;
8178

8279
absl::Status GetGPUResources(const GPUObjectDescriptor* obj_ptr,
8380
GPUResourcesWithValue* resources) const override;

0 commit comments

Comments
 (0)