1//===-- OpenCLImageTypes.def - Metadata about BuiltinTypes ------*- C++ -*-===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9// This file extends builtin types database with OpenCL image singleton types. 10// Custom code should define one of those two macros: 11// GENERIC_IMAGE_TYPE(Type, Id) - a generic image with its Id without an 12// access type 13// IMAGE_TYPE(Type, Id, SingletonId, AccessType, CGSuffix) - an image type 14// with given ID, singleton ID access type and a codegen suffix 15 16#ifdef GENERIC_IMAGE_TYPE 17 18#define IMAGE_READ_TYPE(Type, Id) GENERIC_IMAGE_TYPE(Type, Id) 19#define IMAGE_WRITE_TYPE(Type, Id) 20#define IMAGE_READ_WRITE_TYPE(Type, Id) 21 22#else 23 24#ifndef IMAGE_READ_TYPE 25#define IMAGE_READ_TYPE(Type, Id) \ 26 IMAGE_TYPE(Type, Id##RO, Id##ROTy, read_only, ro) 27#endif 28#ifndef IMAGE_WRITE_TYPE 29#define IMAGE_WRITE_TYPE(Type, Id) \ 30 IMAGE_TYPE(Type, Id##WO, Id##WOTy, write_only, wo) 31#endif 32#ifndef IMAGE_READ_WRITE_TYPE 33#define IMAGE_READ_WRITE_TYPE(Type, Id) \ 34 IMAGE_TYPE(Type, Id##RW, Id##RWTy, read_write, rw) 35#endif 36 37#endif 38 39IMAGE_READ_TYPE(image1d, OCLImage1d) 40IMAGE_READ_TYPE(image1d_array, OCLImage1dArray) 41IMAGE_READ_TYPE(image1d_buffer, OCLImage1dBuffer) 42IMAGE_READ_TYPE(image2d, OCLImage2d) 43IMAGE_READ_TYPE(image2d_array, OCLImage2dArray) 44IMAGE_READ_TYPE(image2d_depth, OCLImage2dDepth) 45IMAGE_READ_TYPE(image2d_array_depth, OCLImage2dArrayDepth) 46IMAGE_READ_TYPE(image2d_msaa, OCLImage2dMSAA) 47IMAGE_READ_TYPE(image2d_array_msaa, OCLImage2dArrayMSAA) 48IMAGE_READ_TYPE(image2d_msaa_depth, OCLImage2dMSAADepth) 49IMAGE_READ_TYPE(image2d_array_msaa_depth, OCLImage2dArrayMSAADepth) 50IMAGE_READ_TYPE(image3d, OCLImage3d) 51 52IMAGE_WRITE_TYPE(image1d, OCLImage1d) 53IMAGE_WRITE_TYPE(image1d_array, OCLImage1dArray) 54IMAGE_WRITE_TYPE(image1d_buffer, OCLImage1dBuffer) 55IMAGE_WRITE_TYPE(image2d, OCLImage2d) 56IMAGE_WRITE_TYPE(image2d_array, OCLImage2dArray) 57IMAGE_WRITE_TYPE(image2d_depth, OCLImage2dDepth) 58IMAGE_WRITE_TYPE(image2d_array_depth, OCLImage2dArrayDepth) 59IMAGE_WRITE_TYPE(image2d_msaa, OCLImage2dMSAA) 60IMAGE_WRITE_TYPE(image2d_array_msaa, OCLImage2dArrayMSAA) 61IMAGE_WRITE_TYPE(image2d_msaa_depth, OCLImage2dMSAADepth) 62IMAGE_WRITE_TYPE(image2d_array_msaa_depth, OCLImage2dArrayMSAADepth) 63IMAGE_WRITE_TYPE(image3d, OCLImage3d) 64 65IMAGE_READ_WRITE_TYPE(image1d, OCLImage1d) 66IMAGE_READ_WRITE_TYPE(image1d_array, OCLImage1dArray) 67IMAGE_READ_WRITE_TYPE(image1d_buffer, OCLImage1dBuffer) 68IMAGE_READ_WRITE_TYPE(image2d, OCLImage2d) 69IMAGE_READ_WRITE_TYPE(image2d_array, OCLImage2dArray) 70IMAGE_READ_WRITE_TYPE(image2d_depth, OCLImage2dDepth) 71IMAGE_READ_WRITE_TYPE(image2d_array_depth, OCLImage2dArrayDepth) 72IMAGE_READ_WRITE_TYPE(image2d_msaa, OCLImage2dMSAA) 73IMAGE_READ_WRITE_TYPE(image2d_array_msaa, OCLImage2dArrayMSAA) 74IMAGE_READ_WRITE_TYPE(image2d_msaa_depth, OCLImage2dMSAADepth) 75IMAGE_READ_WRITE_TYPE(image2d_array_msaa_depth, OCLImage2dArrayMSAADepth) 76IMAGE_READ_WRITE_TYPE(image3d, OCLImage3d) 77 78#undef IMAGE_TYPE 79#undef GENERIC_IMAGE_TYPE 80#undef IMAGE_READ_TYPE 81#undef IMAGE_WRITE_TYPE 82#undef IMAGE_READ_WRITE_TYPE