@@ -1092,24 +1092,26 @@ foreach coordTy = [Int, Float] in {
1092
1092
}
1093
1093
1094
1094
// --- Table 23: Sampler-less Read Functions ---
1095
- foreach aQual = ["RO", "RW"] in {
1096
- foreach imgTy = [Image2d, Image1dArray] in {
1097
- def : Builtin<"read_imagef", [VectorType<Float, 4>, ImageType<imgTy, aQual>, VectorType<Int, 2>], Attr.Pure>;
1098
- def : Builtin<"read_imagei", [VectorType<Int, 4>, ImageType<imgTy, aQual>, VectorType<Int, 2>], Attr.Pure>;
1099
- def : Builtin<"read_imageui", [VectorType<UInt, 4>, ImageType<imgTy, aQual>, VectorType<Int, 2>], Attr.Pure>;
1100
- }
1101
- foreach imgTy = [Image3d, Image2dArray] in {
1102
- def : Builtin<"read_imagef", [VectorType<Float, 4>, ImageType<imgTy, aQual>, VectorType<Int, 4>], Attr.Pure>;
1103
- def : Builtin<"read_imagei", [VectorType<Int, 4>, ImageType<imgTy, aQual>, VectorType<Int, 4>], Attr.Pure>;
1104
- def : Builtin<"read_imageui", [VectorType<UInt, 4>, ImageType<imgTy, aQual>, VectorType<Int, 4>], Attr.Pure>;
1105
- }
1106
- foreach imgTy = [Image1d, Image1dBuffer] in {
1107
- def : Builtin<"read_imagef", [VectorType<Float, 4>, ImageType<imgTy, aQual>, Int], Attr.Pure>;
1108
- def : Builtin<"read_imagei", [VectorType<Int, 4>, ImageType<imgTy, aQual>, Int], Attr.Pure>;
1109
- def : Builtin<"read_imageui", [VectorType<UInt, 4>, ImageType<imgTy, aQual>, Int], Attr.Pure>;
1095
+ let MinVersion = CL12 in {
1096
+ foreach aQual = ["RO", "RW"] in {
1097
+ foreach imgTy = [Image2d, Image1dArray] in {
1098
+ def : Builtin<"read_imagef", [VectorType<Float, 4>, ImageType<imgTy, aQual>, VectorType<Int, 2>], Attr.Pure>;
1099
+ def : Builtin<"read_imagei", [VectorType<Int, 4>, ImageType<imgTy, aQual>, VectorType<Int, 2>], Attr.Pure>;
1100
+ def : Builtin<"read_imageui", [VectorType<UInt, 4>, ImageType<imgTy, aQual>, VectorType<Int, 2>], Attr.Pure>;
1101
+ }
1102
+ foreach imgTy = [Image3d, Image2dArray] in {
1103
+ def : Builtin<"read_imagef", [VectorType<Float, 4>, ImageType<imgTy, aQual>, VectorType<Int, 4>], Attr.Pure>;
1104
+ def : Builtin<"read_imagei", [VectorType<Int, 4>, ImageType<imgTy, aQual>, VectorType<Int, 4>], Attr.Pure>;
1105
+ def : Builtin<"read_imageui", [VectorType<UInt, 4>, ImageType<imgTy, aQual>, VectorType<Int, 4>], Attr.Pure>;
1106
+ }
1107
+ foreach imgTy = [Image1d, Image1dBuffer] in {
1108
+ def : Builtin<"read_imagef", [VectorType<Float, 4>, ImageType<imgTy, aQual>, Int], Attr.Pure>;
1109
+ def : Builtin<"read_imagei", [VectorType<Int, 4>, ImageType<imgTy, aQual>, Int], Attr.Pure>;
1110
+ def : Builtin<"read_imageui", [VectorType<UInt, 4>, ImageType<imgTy, aQual>, Int], Attr.Pure>;
1111
+ }
1112
+ def : Builtin<"read_imagef", [Float, ImageType<Image2dDepth, aQual>, VectorType<Int, 2>], Attr.Pure>;
1113
+ def : Builtin<"read_imagef", [Float, ImageType<Image2dArrayDepth, aQual>, VectorType<Int, 4>], Attr.Pure>;
1110
1114
}
1111
- def : Builtin<"read_imagef", [Float, ImageType<Image2dDepth, aQual>, VectorType<Int, 2>], Attr.Pure>;
1112
- def : Builtin<"read_imagef", [Float, ImageType<Image2dArrayDepth, aQual>, VectorType<Int, 4>], Attr.Pure>;
1113
1115
}
1114
1116
1115
1117
// --- Table 24: Image Write Functions ---
@@ -1187,16 +1189,18 @@ foreach aQual = ["RO"] in {
1187
1189
}
1188
1190
// OpenCL extension v2.0 s5.1.10: Built-in Image Sampler-less Read Functions
1189
1191
// --- Table 9 ---
1190
- foreach aQual = ["RO", "RW"] in {
1191
- foreach name = ["read_imageh"] in {
1192
- foreach imgTy = [Image2d, Image1dArray] in {
1193
- def : Builtin<name, [VectorType<Half, 4>, ImageType<imgTy, aQual>, VectorType<Int, 2>], Attr.Pure>;
1194
- }
1195
- foreach imgTy = [Image3d, Image2dArray] in {
1196
- def : Builtin<name, [VectorType<Half, 4>, ImageType<imgTy, aQual>, VectorType<Int, 4>], Attr.Pure>;
1197
- }
1198
- foreach imgTy = [Image1d, Image1dBuffer] in {
1199
- def : Builtin<name, [VectorType<Half, 4>, ImageType<imgTy, aQual>, Int], Attr.Pure>;
1192
+ let MinVersion = CL12 in {
1193
+ foreach aQual = ["RO", "RW"] in {
1194
+ foreach name = ["read_imageh"] in {
1195
+ foreach imgTy = [Image2d, Image1dArray] in {
1196
+ def : Builtin<name, [VectorType<Half, 4>, ImageType<imgTy, aQual>, VectorType<Int, 2>], Attr.Pure>;
1197
+ }
1198
+ foreach imgTy = [Image3d, Image2dArray] in {
1199
+ def : Builtin<name, [VectorType<Half, 4>, ImageType<imgTy, aQual>, VectorType<Int, 4>], Attr.Pure>;
1200
+ }
1201
+ foreach imgTy = [Image1d, Image1dBuffer] in {
1202
+ def : Builtin<name, [VectorType<Half, 4>, ImageType<imgTy, aQual>, Int], Attr.Pure>;
1203
+ }
1200
1204
}
1201
1205
}
1202
1206
}
0 commit comments