| 173 | } |
| 174 | |
| 175 | std::string ReadGlobalFloat4(TensorStorageType storage_type, |
| 176 | const std::string& tensor_name, |
| 177 | const std::string& global_address, |
| 178 | TextureAddressMode address_mode) { |
| 179 | switch (storage_type) { |
| 180 | case TensorStorageType::BUFFER: |
| 181 | return absl::StrCat("convert_float4(", tensor_name, "[", global_address, |
| 182 | "])"); |
| 183 | case TensorStorageType::TEXTURE_2D: |
| 184 | case TensorStorageType::SINGLE_TEXTURE_2D: |
| 185 | case TensorStorageType::TEXTURE_ARRAY: |
| 186 | return absl::StrCat( |
| 187 | "read_imagef(", tensor_name, |
| 188 | ", " + TextureAddressModeToString(address_mode) + ", ", |
| 189 | global_address, ")"); |
| 190 | case TensorStorageType::UNKNOWN: |
| 191 | return ""; |
| 192 | } |
| 193 | } |
| 194 | |
| 195 | std::string ReadGlobalFLT4(TensorStorageType storage_type, DataType data_type, |
| 196 | const std::string& tensor_name, |
no test coverage detected