diff --git a/hipamd/RELEASE.md b/hipamd/RELEASE.md index 3987255f04..04293d69c0 100644 --- a/hipamd/RELEASE.md +++ b/hipamd/RELEASE.md @@ -8,6 +8,11 @@ We have attempted to document known bugs and limitations - in particular the [HI ## Revision History: +=================================================================================================== +Release: 1.5 +Date: +- HIP texture support equivalent to CUDA texture driver APIs + =================================================================================================== Release: 1.4 Date: 2017.10.06 @@ -23,7 +28,7 @@ Date: 2017.10.06 Release: 1.3 Date: 2017.08.16 - hipcc now auto-detects amdgcn arch. No need to specify the arch when building for same system. -- HIP texture support +- HIP texture support (run-time APIs) - Implemented __threadfence_support - Improvements in HIP context management logic - Bug fixes in several APIs including hipDeviceGetPCIBusId, hipEventDestroy, hipMemcpy2DAsync diff --git a/hipamd/docs/markdown/hip_porting_driver_api.md b/hipamd/docs/markdown/hip_porting_driver_api.md index 0912e676cc..47cb7fb009 100644 --- a/hipamd/docs/markdown/hip_porting_driver_api.md +++ b/hipamd/docs/markdown/hip_porting_driver_api.md @@ -231,3 +231,45 @@ int main(){ return 0; } ``` + +## HIP Module and Texture Driver API + +HIP supports texture driver APIs however texture reference should be declared in host scope. Following code explains the use of texture reference for __HIP_PLATFORM_HCC__ platform. + +``` +// Code to generate code object + +#include "hip/hip_runtime.h" +extern texture tex; + +__global__ void tex2dKernel(hipLaunchParm lp, float* outputData, + int width, + int height) +{ + int x = hipBlockIdx_x*hipBlockDim_x + hipThreadIdx_x; + int y = hipBlockIdx_y*hipBlockDim_y + hipThreadIdx_y; + outputData[y*width + x] = tex2D(tex, x, y); +} + +``` +``` +// Host code: + +texture tex; + +void myFunc () +{ + // ... + + textureReference* texref; + hipModuleGetTexRef(&texref, Module1, "tex"); + hipTexRefSetAddressMode(texref, 0, hipAddressModeWrap); + hipTexRefSetAddressMode(texref, 1, hipAddressModeWrap); + hipTexRefSetFilterMode(texref, hipFilterModePoint); + hipTexRefSetFlags(texref, 0); + hipTexRefSetFormat(texref, HIP_AD_FORMAT_FLOAT, 1); + hipTexRefSetArray(texref, array, HIP_TRSA_OVERRIDE_FORMAT); + + // ... +} +``` \ No newline at end of file diff --git a/hipamd/docs/markdown/hip_porting_guide.md b/hipamd/docs/markdown/hip_porting_guide.md index 12ec931f2a..aeb7b171d6 100644 --- a/hipamd/docs/markdown/hip_porting_guide.md +++ b/hipamd/docs/markdown/hip_porting_guide.md @@ -465,34 +465,36 @@ a performance impact. ### Textures and Cache Control ->Texture support is under-development and not yet supported by HIP. - Compute programs sometimes use textures either to access dedicated texture caches or to use the texture-sampling hardware for interpolation and clamping. The former approach uses simple point samplers with linear interpolation, essentially only reading a single point. The latter approach uses the sampler hardware to interpolate and combine multiple point samples. AMD hardware, as well as recent competing hardware, has a unified texture/L1 cache, so it no longer has a dedicated texture cache. But the nvcc path often caches global loads in the L2 cache, and some programs may benefit from explicit control of the L1 cache contents. We recommend the __ldg instruction for this purpose. -HIP currently lacks texture support; a future revision will add this capability. Also, AMD compilers currently load all data into both the L1 and L2 caches, so __ldg is treated as a no-op. +AMD compilers currently load all data into both the L1 and L2 caches, so __ldg is treated as a no-op. We recommend the following for functional portability: - For programs that use textures only to benefit from improved caching, use the __ldg instruction -- Alternatively, use conditional compilation (see [Identify HIP Target Platform](#identify-hip-target-platform)) - - For the `__HIP_PLATFORM_NVCC__` path, use the full texture path - - For the `__HIP_PLATFORM_HCC__` path, pass an additional pointer to the kernel and reference it using regular device memory-load instructions rather than texture loads. Some applications may already take this step, since it allows experimentation with caching behavior. +- Programs that use texture object APIs, work well on HIP +- For program that use texture reference APIs, use conditional compilation (see [Identify HIP Target Platform](#identify-hip-target-platform)) + - For the `__HIP_PLATFORM_HCC__` path, pass an additional argument to the kernel and in texture fetch API inside kernel as shown below:- ``` -texture t_features; +texture tex; -void __global__ MyKernel(float *d_features /* pass pointer parameter, if not already available */...) -{ - // ... - -#ifdef __HIP_PLATFORM_NVCC__ - float tval = tex1Dfetch(t_features,addr); -#else - float tval = d_features[addr]; +__global__ void tex2DKernel(float* outputData, +#ifdef __HIP_PLATFORM_HCC__ + hipTextureObject_t textureObject, +#endif + int width, + int height) +{ + int x = blockIdx.x*blockDim.x + threadIdx.x; + int y = blockIdx.y*blockDim.y + threadIdx.y; +#ifdef __HIP_PLATFORM_HCC__ + outputData[y*width + x] = tex2D(tex, textureObject, x, y); +#else + outputData[y*width + x] = tex2D(tex, x, y); #endif - } // Host code: @@ -500,23 +502,15 @@ void myFunc () { // ... -#ifdef __HIP_PLATFORM_NVCC__ - cudaChannelFormatDesc chDesc0 = cudaCreateChannelDesc(); - t_features.filterMode = cudaFilterModePoint; - t_features.normalized = false; - t_features.channelDesc = chDesc0; - - cudaBindTexture(NULL, &t_features, d_features, &chDesc0, npoints*nfeatures*sizeof(float)); +#ifdef __HIP_PLATFORM_HCC__ + hipLaunchKernelGGL(tex2DKernel, dim3(dimGrid), dim3(dimBlock), 0, 0, dData, tex.textureObject, width, height); +#else + hipLaunchKernelGGL(tex2DKernel, dim3(dimGrid), dim3(dimBlock), 0, 0, dData, width, height); #endif + ``` -Additionally, many of the Rodinia benchmarks demonstrate how to modify hipified programs so that textures are not required - search for USE_TEXTURES define in the rodinia source directory. -For example, [here - - -Cuda programs that employ sampler hardware must either wait for hcc texture support or use more-sophisticated workarounds. - ## More Tips ### HIPTRACE Mode diff --git a/hipamd/include/hip/hcc_detail/driver_types.h b/hipamd/include/hip/hcc_detail/driver_types.h index ce5e9789be..5b31e3cd16 100644 --- a/hipamd/include/hip/hcc_detail/driver_types.h +++ b/hipamd/include/hip/hcc_detail/driver_types.h @@ -23,6 +23,7 @@ THE SOFTWARE. #ifndef HIP_INCLUDE_HIP_HCC_DETAIL_DRIVER_TYPES_H #define HIP_INCLUDE_HIP_HCC_DETAIL_DRIVER_TYPES_H +typedef void* hipDeviceptr_t; enum hipChannelFormatKind { hipChannelFormatKindSigned = 0, @@ -40,6 +41,29 @@ struct hipChannelFormatDesc enum hipChannelFormatKind f; }; +#define HIP_TRSF_NORMALIZED_COORDINATES 0x02 +#define HIP_TRSF_READ_AS_INTEGER 0x01 +#define HIP_TRSA_OVERRIDE_FORMAT 0x01 + +enum hipArray_Format +{ + HIP_AD_FORMAT_UNSIGNED_INT8 = 0x01, + HIP_AD_FORMAT_UNSIGNED_INT16 = 0x02, + HIP_AD_FORMAT_UNSIGNED_INT32 = 0x03, + HIP_AD_FORMAT_SIGNED_INT8 = 0x08, + HIP_AD_FORMAT_SIGNED_INT16 = 0x09, + HIP_AD_FORMAT_SIGNED_INT32 = 0x0a, + HIP_AD_FORMAT_HALF = 0x10, + HIP_AD_FORMAT_FLOAT = 0x20 +}; + +struct HIP_ARRAY_DESCRIPTOR { + enum hipArray_Format format; + unsigned int numChannels; + size_t width; + size_t height; +}; + struct hipArray { void* data; //FIXME: generalize this struct hipChannelFormatDesc desc; @@ -47,8 +71,30 @@ struct hipArray { unsigned int width; unsigned int height; unsigned int depth; + struct HIP_ARRAY_DESCRIPTOR drvDesc; + bool isDrv; }; +typedef struct hip_Memcpy2D { + size_t height; + size_t widthInBytes; + hipArray* dstArray; + hipDeviceptr_t dstDevice; + void * dstHost; + hipMemoryType dstMemoryType; + size_t dstPitch; + size_t dstXInBytes; + size_t dstY; + hipArray* srcArray; + hipDeviceptr_t srcDevice; + const void * srcHost; + hipMemoryType srcMemoryType; + size_t srcPitch; + size_t srcXInBytes; + size_t srcY; +}hip_Memcpy2D; + + typedef struct hipArray* hipArray_t; typedef const struct hipArray* hipArray_const_t; diff --git a/hipamd/include/hip/hcc_detail/hip_runtime_api.h b/hipamd/include/hip/hcc_detail/hip_runtime_api.h index 03be587b0d..16f13ebee2 100644 --- a/hipamd/include/hip/hcc_detail/hip_runtime_api.h +++ b/hipamd/include/hip/hcc_detail/hip_runtime_api.h @@ -84,8 +84,6 @@ typedef struct ihipModule_t *hipModule_t; typedef struct ihipModuleSymbol_t *hipFunction_t; -typedef void* hipDeviceptr_t; - typedef struct ihipEvent_t *hipEvent_t; enum hipLimit_t @@ -621,7 +619,7 @@ hipError_t hipStreamQuery(hipStream_t stream); * * This command is host-synchronous : the host will block until the specified stream is empty. * - * This command follows standard null-stream semantics. Specifically, specifying the null stream will cause the + * This command follows standard null-stream semantics. Specifically, specifying the null stream will cause the * command to wait for other streams on the same device to complete all pending operations. * * This command honors the hipDeviceLaunchBlocking flag, which controls whether the wait is active or blocking. @@ -644,9 +642,9 @@ hipError_t hipStreamSynchronize(hipStream_t stream); * This function inserts a wait operation into the specified stream. * All future work submitted to @p stream will wait until @p event reports completion before beginning execution. * - * This function only waits for commands in the current stream to complete. Notably,, this function does - * not impliciy wait for commands in the default stream to complete, even if the specified stream is - * created with hipStreamNonBlocking = 0. + * This function only waits for commands in the current stream to complete. Notably,, this function does + * not impliciy wait for commands in the default stream to complete, even if the specified stream is + * created with hipStreamNonBlocking = 0. * * @see hipStreamCreate, hipStreamCreateWithFlags, hipStreamSynchronize, hipStreamDestroy */ @@ -756,7 +754,7 @@ hipError_t hipEventCreate(hipEvent_t* event); * If hipEventRecord() has been previously called on this event, then this call will overwrite any existing state in event. * * If this function is called on a an event that is currently being recorded, results are undefined - either - * outstanding recording may save state into the event, and the order is not guaranteed. + * outstanding recording may save state into the event, and the order is not guaranteed. * * @see hipEventCreate, hipEventCreateWithFlags, hipEventQuery, hipEventSynchronize, hipEventDestroy, hipEventElapsedTime * @@ -1318,6 +1316,7 @@ hipError_t hipMallocArray(hipArray** array, const hipChannelFormatDesc* desc, hipError_t hipMallocArray(hipArray** array, const struct hipChannelFormatDesc* desc, size_t width, size_t height, unsigned int flags); #endif +hipError_t hipArrayCreate ( hipArray** pHandle, const HIP_ARRAY_DESCRIPTOR* pAllocateArray ); /** * @brief Frees an array on the device. * @@ -1359,6 +1358,7 @@ hipError_t hipMalloc3DArray(hipArray_t *array, * @see hipMemcpy, hipMemcpyToArray, hipMemcpy2DToArray, hipMemcpyFromArray, hipMemcpyToSymbol, hipMemcpyAsync */ hipError_t hipMemcpy2D(void* dst, size_t dpitch, const void* src, size_t spitch, size_t width, size_t height, hipMemcpyKind kind); +hipError_t hipMemcpyParam2D(const hip_Memcpy2D* pCopy); /** * @brief Copies data between host and device. @@ -1968,6 +1968,7 @@ hipError_t hipModuleGetFunction(hipFunction_t *function, hipModule_t module, con */ hipError_t hipModuleGetGlobal(hipDeviceptr_t *dptr, size_t *bytes, hipModule_t hmod, const char *name); +hipError_t hipModuleGetTexRef(textureReference** texRef, hipModule_t hmod, const char* name); /** * @brief builds module from code object which resides in host memory. Image is pointer to that location. * @@ -2172,12 +2173,9 @@ hipError_t ihipBindTextureImpl(int dim, enum hipTextureReadMode readMode, size_t *offset, const void *devPtr, - const struct hipChannelFormatDesc& desc, + const struct hipChannelFormatDesc* desc, size_t size, - enum hipTextureAddressMode addressMode, - enum hipTextureFilterMode filterMode, - int normalizedCoords, - hipTextureObject_t& textureObject); + textureReference* tex); /* * @brief hipBindTexture Binds size bytes of the memory area pointed to by @p devPtr to the texture reference tex. @@ -2199,9 +2197,7 @@ hipError_t hipBindTexture(size_t *offset, const struct hipChannelFormatDesc& desc, size_t size = UINT_MAX) { - return ihipBindTextureImpl(dim, readMode, offset, devPtr, desc, size, - tex.addressMode[0], tex.filterMode, tex.normalized, - tex.textureObject); + return ihipBindTextureImpl(dim, readMode, offset, devPtr, &desc, size, &tex); } /* @@ -2222,9 +2218,7 @@ hipError_t hipBindTexture(size_t *offset, const void *devPtr, size_t size = UINT_MAX) { - return ihipBindTextureImpl(dim, readMode, offset, devPtr, tex.channelDesc, size, - tex.addressMode[0], tex.filterMode, tex.normalized, - tex.textureObject); + return ihipBindTextureImpl(dim, readMode, offset, devPtr, &(tex.channelDesc), size, &tex); } // C API @@ -2240,13 +2234,10 @@ hipError_t ihipBindTexture2DImpl(int dim, enum hipTextureReadMode readMode, size_t *offset, const void *devPtr, - const struct hipChannelFormatDesc& desc, + const struct hipChannelFormatDesc* desc, size_t width, size_t height, - enum hipTextureAddressMode addressMode, - enum hipTextureFilterMode filterMode, - int normalizedCoords, - hipTextureObject_t& textureObject); + textureReference* tex); template hipError_t hipBindTexture2D(size_t *offset, @@ -2256,9 +2247,7 @@ hipError_t hipBindTexture2D(size_t *offset, size_t height, size_t pitch) { - return ihipBindTexture2DImpl(dim, readMode, offset, devPtr, tex.channelDesc, width, height, - tex.addressMode[0], tex.filterMode, tex.normalized, - tex.textureObject); + return ihipBindTexture2DImpl(dim, readMode, offset, devPtr, &(tex.channelDesc), width, height, &tex); } template @@ -2270,9 +2259,7 @@ hipError_t hipBindTexture2D(size_t *offset, size_t height, size_t pitch) { - return ihipBindTexture2DImpl(dim, readMode, offset, devPtr, desc, width, height, - tex.addressMode[0], tex.filterMode, tex.normalized, - tex.textureObject); + return ihipBindTexture2DImpl(dim, readMode, offset, devPtr, &desc, width, height, &tex); } //C API @@ -2284,18 +2271,13 @@ hipError_t ihipBindTextureToArrayImpl(int dim, enum hipTextureReadMode readMode, hipArray_const_t array, const struct hipChannelFormatDesc& desc, - enum hipTextureAddressMode addressMode, - enum hipTextureFilterMode filterMode, - int normalizedCoords, - hipTextureObject_t& textureObject); + textureReference* tex); template hipError_t hipBindTextureToArray(struct texture& tex, hipArray_const_t array) { - return ihipBindTextureToArrayImpl(dim, readMode, array, tex.channelDesc, - tex.addressMode[0], tex.filterMode, tex.normalized, - tex.textureObject); + return ihipBindTextureToArrayImpl(dim, readMode, array, tex.channelDesc, &tex); } template @@ -2303,9 +2285,7 @@ hipError_t hipBindTextureToArray(struct texture& tex, hipArray_const_t array, const struct hipChannelFormatDesc& desc) { - return ihipBindTextureToArrayImpl(dim, readMode, array, desc, - tex.addressMode[0], tex.filterMode, tex.normalized, - tex.textureObject); + return ihipBindTextureToArrayImpl(dim, readMode, array, desc, &tex); } //C API @@ -2359,6 +2339,19 @@ hipError_t hipDestroyTextureObject(hipTextureObject_t textureObject); hipError_t hipGetTextureObjectResourceDesc(hipResourceDesc* pResDesc, hipTextureObject_t textureObject); hipError_t hipGetTextureObjectResourceViewDesc(hipResourceViewDesc* pResViewDesc, hipTextureObject_t textureObject); hipError_t hipGetTextureObjectTextureDesc(hipTextureDesc* pTexDesc, hipTextureObject_t textureObject); +hipError_t hipTexRefSetArray ( textureReference* tex, hipArray_const_t array, unsigned int flags ); + +hipError_t hipTexRefSetAddressMode ( textureReference* tex, int dim, hipTextureAddressMode am ); + +hipError_t hipTexRefSetFilterMode ( textureReference* tex, hipTextureFilterMode fm ); + +hipError_t hipTexRefSetFlags ( textureReference* tex, unsigned int flags ); + +hipError_t hipTexRefSetFormat (textureReference* tex, hipArray_Format fmt, int NumPackedComponents ); + +hipError_t hipTexRefSetAddress( size_t* offset, textureReference* tex, hipDeviceptr_t devPtr, size_t size ); + +hipError_t hipTexRefSetAddress2D( textureReference* tex, const HIP_ARRAY_DESCRIPTOR* desc, hipDeviceptr_t devPtr, size_t pitch ); // doxygen end Texture /** diff --git a/hipamd/include/hip/hcc_detail/texture_functions.h b/hipamd/include/hip/hcc_detail/texture_functions.h index d08b429fca..3675c0639d 100644 --- a/hipamd/include/hip/hcc_detail/texture_functions.h +++ b/hipamd/include/hip/hcc_detail/texture_functions.h @@ -39,7 +39,10 @@ union TData { unsigned int ADDRESS_SPACE_2 *i = (unsigned int ADDRESS_SPACE_2*)textureObject; \ unsigned int ADDRESS_SPACE_2 *s = i + HIP_SAMPLER_OBJECT_OFFSET_DWORD; \ TData texel; - +#define TEXTURE_REF_PARAMETERS_INIT \ + unsigned int ADDRESS_SPACE_2 *i = (unsigned int ADDRESS_SPACE_2*)texRef.textureObject; \ + unsigned int ADDRESS_SPACE_2 *s = i + HIP_SAMPLER_OBJECT_OFFSET_DWORD; \ + TData texel; #define TEXTURE_SET_FLOAT \ *retVal = texel.f.x; @@ -2970,6 +2973,232 @@ __TEXTURE_FUNCTIONS_DECL__ T tex2DLayeredLod(hipTextureObject_t textureObject, f //////////////////////////////////////////////////////////// // Texture Reference APIs //////////////////////////////////////////////////////////// +template +__TEXTURE_FUNCTIONS_DECL__ char tex1Dfetch(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_CHAR; +} + +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex1Dfetch(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_CHAR_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex1Dfetch(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_CHAR_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex1Dfetch(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_CHAR_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1Dfetch(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_UCHAR; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1Dfetch(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_UCHAR_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1Dfetch(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_UCHAR_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1Dfetch(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_UCHAR_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short tex1Dfetch(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_SHORT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex1Dfetch(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_SHORT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex1Dfetch(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_SHORT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex1Dfetch(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_SHORT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1Dfetch(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_USHORT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1Dfetch(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_USHORT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1Dfetch(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_USHORT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1Dfetch(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_USHORT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex1Dfetch(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_INT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int tex1Dfetch(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_INT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex1Dfetch(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_INT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex1Dfetch(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_INT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1Dfetch(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_UINT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex1Dfetch(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_UINT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex1Dfetch(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_UINT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex1Dfetch(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_UINT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float tex1Dfetch(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_FLOAT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex1Dfetch(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_FLOAT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex1Dfetch(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_FLOAT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex1Dfetch(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_FLOAT_XYZW; +} + +//////////////////////////////////////////////////////////// + template __TEXTURE_FUNCTIONS_DECL__ char tex1Dfetch(texture texRef, hipTextureObject_t textureObject, int x) { @@ -3194,6 +3423,223 @@ __TEXTURE_FUNCTIONS_DECL__ float4 tex1Dfetch(texture texR TEXTURE_RETURN_FLOAT_XYZW; } +//////////////////////////////////////////////////////////// +template +__TEXTURE_FUNCTIONS_DECL__ char tex1D(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_CHAR; +} + +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex1D(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_CHAR_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex1D(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_CHAR_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex1D(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_CHAR_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1D(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_UCHAR; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1D(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_UCHAR_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1D(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_UCHAR_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1D(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_UCHAR_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short tex1D(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_SHORT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex1D(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_SHORT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex1D(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_SHORT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex1D(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_SHORT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1D(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_USHORT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1D(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_USHORT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1D(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_USHORT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1D(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_USHORT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int tex1D(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_INT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex1D(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_INT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex1D(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_INT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex1D(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_INT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1D(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_UINT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex1D(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_UINT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex1D(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_UINT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex1D(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_UINT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex1D(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_FLOAT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex1D(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_FLOAT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex1D(texture texRef, int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_FLOAT_XYZW; +} + //////////////////////////////////////////////////////////// template __TEXTURE_FUNCTIONS_DECL__ char tex1D(texture texRef, hipTextureObject_t textureObject, int x) @@ -3395,6 +3841,14 @@ __TEXTURE_FUNCTIONS_DECL__ float tex1D(texture texRef, hip TEXTURE_RETURN_FLOAT; } +template +__TEXTURE_FUNCTIONS_DECL__ float tex1D(texture texRef, /*hipTextureObject_t textureObject,*/ int x) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1D(i, s, x); + TEXTURE_RETURN_FLOAT; +} + template __TEXTURE_FUNCTIONS_DECL__ float1 tex1D(texture texRef, hipTextureObject_t textureObject, int x) { @@ -3421,6 +3875,231 @@ __TEXTURE_FUNCTIONS_DECL__ float4 tex1D(texture texRef, h //////////////////////////////////////////////////////////// +template +__TEXTURE_FUNCTIONS_DECL__ char tex1DLod(texture texRef, float x, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1D(i, s, x, level); + TEXTURE_RETURN_CHAR; +} + +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex1DLod(texture texRef, float x, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1D(i, s, x, level); + TEXTURE_RETURN_CHAR_X; +} +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex1DLod(texture texRef, float x, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1D(i, s, x, level); + TEXTURE_RETURN_CHAR_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex1DLod(texture texRef, float x, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1D(i, s, x, level); + TEXTURE_RETURN_CHAR_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DLod(texture texRef, float x, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1D(i, s, x, level); + TEXTURE_RETURN_UCHAR; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DLod(texture texRef, float x, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1D(i, s, x, level); + TEXTURE_RETURN_UCHAR_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DLod(texture texRef, float x, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1D(i, s, x, level); + TEXTURE_RETURN_UCHAR_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DLod(texture texRef, float x, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1D(i, s, x, level); + TEXTURE_RETURN_UCHAR_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short tex1DLod(texture texRef, float x, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1D(i, s, x, level); + TEXTURE_RETURN_SHORT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex1DLod(texture texRef, float x, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1D(i, s, x, level); + TEXTURE_RETURN_SHORT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex1DLod(texture texRef, float x, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1D(i, s, x, level); + TEXTURE_RETURN_SHORT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex1DLod(texture texRef, float x, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1D(i, s, x, level); + TEXTURE_RETURN_SHORT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DLod(texture texRef, float x, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1D(i, s, x, level); + TEXTURE_RETURN_USHORT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DLod(texture texRef, float x, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1D(i, s, x, level); + TEXTURE_RETURN_USHORT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DLod(texture texRef, float x, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1D(i, s, x, level); + TEXTURE_RETURN_USHORT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DLod(texture texRef, float x, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1D(i, s, x, level); + TEXTURE_RETURN_USHORT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int tex1DLod(texture texRef, float x, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1D(i, s, x, level); + TEXTURE_RETURN_INT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex1DLod(texture texRef, float x, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1D(i, s, x, level); + TEXTURE_RETURN_INT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex1DLod(texture texRef, float x, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1D(i, s, x, level); + TEXTURE_RETURN_INT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex1DLod(texture texRef, float x, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1D(i, s, x, level); + TEXTURE_RETURN_INT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DLod(texture texRef, float x, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1D(i, s, x, level); + TEXTURE_RETURN_UINT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex1DLod(texture texRef, float x, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1D(i, s, x, level); + TEXTURE_RETURN_UINT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex1DLod(texture texRef, float x, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1D(i, s, x, level); + TEXTURE_RETURN_UINT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex1DLod(texture texRef, float x, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1D(i, s, x, level); + TEXTURE_RETURN_UINT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float tex1DLod(texture texRef, float x, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1D(i, s, x, level); + TEXTURE_RETURN_FLOAT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex1DLod(texture texRef, float x, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1D(i, s, x, level); + TEXTURE_RETURN_FLOAT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex1DLod(texture texRef, float x, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1D(i, s, x, level); + TEXTURE_RETURN_FLOAT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex1DLod(texture texRef, float x, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1D(i, s, x, level); + TEXTURE_RETURN_FLOAT_XYZW; +} + +//////////////////////////////////////////////////////////// + template __TEXTURE_FUNCTIONS_DECL__ char tex1DLod(texture texRef, hipTextureObject_t textureObject, float x, float level) { @@ -3646,6 +4325,232 @@ __TEXTURE_FUNCTIONS_DECL__ float4 tex1DLod(texture texRef //////////////////////////////////////////////////////////// +template +__TEXTURE_FUNCTIONS_DECL__ char tex1DGrad(texture texRef, float x, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); + TEXTURE_RETURN_CHAR; +} + +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex1DGrad(texture texRef, float x, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); + TEXTURE_RETURN_CHAR_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex1DGrad(texture texRef, float x, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); + TEXTURE_RETURN_CHAR_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex1DGrad(texture texRef, float x, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); + TEXTURE_RETURN_CHAR_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DGrad(texture texRef, float x, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); + TEXTURE_RETURN_UCHAR; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DGrad(texture texRef, float x, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); + TEXTURE_RETURN_UCHAR_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DGrad(texture texRef, float x, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); + TEXTURE_RETURN_UCHAR_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DGrad(texture texRef, float x, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); + TEXTURE_RETURN_UCHAR_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short tex1DGrad(texture texRef, float x, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); + TEXTURE_RETURN_SHORT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex1DGrad(texture texRef, float x, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); + TEXTURE_RETURN_SHORT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex1DGrad(texture texRef, float x, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); + TEXTURE_RETURN_SHORT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex1DGrad(texture texRef, float x, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); + TEXTURE_RETURN_SHORT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DGrad(texture texRef, float x, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); + TEXTURE_RETURN_USHORT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DGrad(texture texRef, float x, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); + TEXTURE_RETURN_USHORT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DGrad(texture texRef, float x, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); + TEXTURE_RETURN_USHORT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DGrad(texture texRef, float x, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); + TEXTURE_RETURN_USHORT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int tex1DGrad(texture texRef, float x, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); + TEXTURE_RETURN_INT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex1DGrad(texture texRef, float x, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); + TEXTURE_RETURN_INT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex1DGrad(texture texRef, float x, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); + TEXTURE_RETURN_INT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex1DGrad(texture texRef, float x, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); + TEXTURE_RETURN_INT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DGrad(texture texRef, float x, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); + TEXTURE_RETURN_UINT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex1DGrad(texture texRef, float x, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); + TEXTURE_RETURN_UINT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex1DGrad(texture texRef, float x, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); + TEXTURE_RETURN_UINT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex1DGrad(texture texRef, float x, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); + TEXTURE_RETURN_UINT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float tex1DGrad(texture texRef, float x, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); + TEXTURE_RETURN_FLOAT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex1DGrad(texture texRef, float x, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); + TEXTURE_RETURN_FLOAT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex1DGrad(texture texRef, float x, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); + TEXTURE_RETURN_FLOAT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex1DGrad(texture texRef, float x, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1D(i, s, x, dx, dy); + TEXTURE_RETURN_FLOAT_XYZW; +} + +//////////////////////////////////////////////////////////// + template __TEXTURE_FUNCTIONS_DECL__ char tex1DGrad(texture texRef, hipTextureObject_t textureObject, float x, float dx, float dy) { @@ -3870,6 +4775,202 @@ __TEXTURE_FUNCTIONS_DECL__ float4 tex1DGrad(texture texRe TEXTURE_RETURN_FLOAT_XYZW; } +//////////////////////////////////////////////////////////// + +template +__TEXTURE_FUNCTIONS_DECL__ char tex2D(texture texRef, float x, float y) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); + TEXTURE_RETURN_CHAR; +} + +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex2D(texture texRef, float x, float y) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); + TEXTURE_RETURN_CHAR_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex2D(texture texRef, float x, float y) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); + TEXTURE_RETURN_CHAR_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex2D(texture texRef, float x, float y) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); + TEXTURE_RETURN_CHAR_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex2D(texture texRef, float x, float y) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); + TEXTURE_RETURN_UCHAR; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex2D(texture texRef, float x, float y) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); + TEXTURE_RETURN_UCHAR_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex2D(texture texRef, float x, float y) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); + TEXTURE_RETURN_UCHAR_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex2D(texture texRef, float x, float y) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); + TEXTURE_RETURN_UCHAR_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short tex2D(texture texRef, float x, float y) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); + TEXTURE_RETURN_SHORT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex2D(texture texRef, float x, float y) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); + TEXTURE_RETURN_SHORT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex2D(texture texRef, float x, float y) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); + TEXTURE_RETURN_SHORT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex2D(texture texRef, float x, float y) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); + TEXTURE_RETURN_SHORT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex2D(texture texRef, float x, float y) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); + TEXTURE_RETURN_USHORT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex2D(texture texRef, float x, float y) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); + TEXTURE_RETURN_USHORT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex2D(texture texRef, float x, float y) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); + TEXTURE_RETURN_USHORT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex2D(texture texRef, float x, float y) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); + TEXTURE_RETURN_USHORT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int tex2D(texture texRef, float x, float y) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); + TEXTURE_RETURN_INT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex2D(texture texRef, float x, float y) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); + TEXTURE_RETURN_INT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex2D(texture texRef, float x, float y) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); + TEXTURE_RETURN_INT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex2D(texture texRef, float x, float y) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); + TEXTURE_RETURN_INT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex2D(texture texRef, float x, float y) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); + TEXTURE_RETURN_UINT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex2D(texture texRef, float x, float y) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); + TEXTURE_RETURN_UINT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex2D(texture texRef, float x, float y) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); + TEXTURE_RETURN_UINT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex2D(texture texRef, float x, float y) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); + TEXTURE_RETURN_UINT_XYZW; +} + + + //////////////////////////////////////////////////////////// template @@ -4072,6 +5173,22 @@ __TEXTURE_FUNCTIONS_DECL__ float tex2D(texture texRef, hip TEXTURE_RETURN_FLOAT; } +template +__TEXTURE_FUNCTIONS_DECL__ float tex2D(texture texRef, float x, float y) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); + TEXTURE_RETURN_FLOAT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex2D(texture texRef, float x, float y) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); + TEXTURE_RETURN_FLOAT_X; +} + template __TEXTURE_FUNCTIONS_DECL__ float1 tex2D(texture texRef, hipTextureObject_t textureObject, float x, float y) { @@ -4080,6 +5197,14 @@ __TEXTURE_FUNCTIONS_DECL__ float1 tex2D(texture texRef, h TEXTURE_RETURN_FLOAT_X; } +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex2D(texture texRef, float x, float y) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); + TEXTURE_RETURN_FLOAT_XY; +} + template __TEXTURE_FUNCTIONS_DECL__ float2 tex2D(texture texRef, hipTextureObject_t textureObject, float x, float y) { @@ -4088,6 +5213,14 @@ __TEXTURE_FUNCTIONS_DECL__ float2 tex2D(texture texRef, h TEXTURE_RETURN_FLOAT_XY; } +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex2D(texture texRef, float x, float y) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2D(i, s, hc::short_vector::float2(x, y).get_vector()); + TEXTURE_RETURN_FLOAT_XYZW; +} + template __TEXTURE_FUNCTIONS_DECL__ float4 tex2D(texture texRef, hipTextureObject_t textureObject, float x, float y) { @@ -4098,6 +5231,232 @@ __TEXTURE_FUNCTIONS_DECL__ float4 tex2D(texture texRef, h //////////////////////////////////////////////////////////// +template +__TEXTURE_FUNCTIONS_DECL__ char tex2DLod(texture texRef, float x, float y, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); + TEXTURE_RETURN_CHAR; +} + +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex2DLod(texture texRef, float x, float y, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); + TEXTURE_RETURN_CHAR_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex2DLod(texture texRef, float x, float y, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); + TEXTURE_RETURN_CHAR_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex2DLod(texture texRef, float x, float y, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); + TEXTURE_RETURN_CHAR_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DLod(texture texRef, float x, float y, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); + TEXTURE_RETURN_UCHAR; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DLod(texture texRef, float x, float y, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); + TEXTURE_RETURN_UCHAR_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DLod(texture texRef, float x, float y, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); + TEXTURE_RETURN_UCHAR_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DLod(texture texRef, float x, float y, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); + TEXTURE_RETURN_UCHAR_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short tex2DLod(texture texRef, float x, float y, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); + TEXTURE_RETURN_SHORT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex2DLod(texture texRef, float x, float y, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); + TEXTURE_RETURN_SHORT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex2DLod(texture texRef, float x, float y, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); + TEXTURE_RETURN_SHORT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex2DLod(texture texRef, float x, float y, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); + TEXTURE_RETURN_SHORT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DLod(texture texRef, float x, float y, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); + TEXTURE_RETURN_USHORT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DLod(texture texRef, float x, float y, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); + TEXTURE_RETURN_USHORT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DLod(texture texRef, float x, float y, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); + TEXTURE_RETURN_USHORT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DLod(texture texRef, float x, float y, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); + TEXTURE_RETURN_USHORT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int tex2DLod(texture texRef, float x, float y, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); + TEXTURE_RETURN_INT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex2DLod(texture texRef, float x, float y, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); + TEXTURE_RETURN_INT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex2DLod(texture texRef, float x, float y, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); + TEXTURE_RETURN_INT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex2DLod(texture texRef, float x, float y, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); + TEXTURE_RETURN_INT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DLod(texture texRef, float x, float y, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); + TEXTURE_RETURN_UINT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex2DLod(texture texRef, float x, float y, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); + TEXTURE_RETURN_UINT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex2DLod(texture texRef, float x, float y, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); + TEXTURE_RETURN_UINT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex2DLod(texture texRef, float x, float y, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); + TEXTURE_RETURN_UINT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float tex2DLod(texture texRef, float x, float y, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); + TEXTURE_RETURN_FLOAT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex2DLod(texture texRef, float x, float y, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); + TEXTURE_RETURN_FLOAT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex2DLod(texture texRef, float x, float y, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); + TEXTURE_RETURN_FLOAT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex2DLod(texture texRef, float x, float y, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2D(i, s, hc::short_vector::float2(x, y).get_vector(), level); + TEXTURE_RETURN_FLOAT_XYZW; +} + +//////////////////////////////////////////////////////////// + template __TEXTURE_FUNCTIONS_DECL__ char tex2DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float level) { @@ -4324,6 +5683,316 @@ __TEXTURE_FUNCTIONS_DECL__ float4 tex2DLod(texture texRef //////////////////////////////////////////////////////////// +template +__TEXTURE_FUNCTIONS_DECL__ char tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2D(i, s, + hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_CHAR; +} + +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2D(i, s, + hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_CHAR_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2D(i, s, + hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_CHAR_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2D(i, s, + hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_CHAR_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2D(i, s, + hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_UCHAR; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2D(i, s, + hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_UCHAR_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2D(i, s, + hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_UCHAR_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2D(i, s, + hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_UCHAR_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2D(i, s, + hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_SHORT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2D(i, s, + hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_SHORT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2D(i, s, + hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_SHORT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2D(i, s, + hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_SHORT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2D(i, s, + hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_USHORT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2D(i, s, + hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_USHORT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2D(i, s, + hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_USHORT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2D(i, s, + hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_USHORT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2D(i, s, + hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_INT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2D(i, s, + hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_INT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2D(i, s, + hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_INT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2D(i, s, + hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_INT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2D(i, s, + hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_UINT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2D(i, s, + hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_UINT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2D(i, s, + hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_UINT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2D(i, s, + hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_UINT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2D(i, s, + hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_FLOAT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2D(i, s, + hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_FLOAT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2D(i, s, + hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_FLOAT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex2DGrad(texture texRef, float x, float y, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2D(i, s, + hc::short_vector::float2(x, y).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_FLOAT_XYZW; +} + +//////////////////////////////////////////////////////////// + template __TEXTURE_FUNCTIONS_DECL__ char tex2DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float2 dx, float2 dy) { @@ -4634,6 +6303,232 @@ __TEXTURE_FUNCTIONS_DECL__ float4 tex2DGrad(texture texRe //////////////////////////////////////////////////////////// +template +__TEXTURE_FUNCTIONS_DECL__ char tex3D(texture texRef, float x, float y, float z) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); + TEXTURE_RETURN_CHAR; +} + +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex3D(texture texRef, float x, float y, float z) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); + TEXTURE_RETURN_CHAR_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex3D(texture texRef, float x, float y, float z) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); + TEXTURE_RETURN_CHAR_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex3D(texture texRef, float x, float y, float z) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); + TEXTURE_RETURN_CHAR_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex3D(texture texRef, float x, float y, float z) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); + TEXTURE_RETURN_UCHAR; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex3D(texture texRef, float x, float y, float z) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); + TEXTURE_RETURN_UCHAR_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex3D(texture texRef, float x, float y, float z) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); + TEXTURE_RETURN_UCHAR_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex3D(texture texRef, float x, float y, float z) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); + TEXTURE_RETURN_UCHAR_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short tex3D(texture texRef, float x, float y, float z) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); + TEXTURE_RETURN_SHORT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex3D(texture texRef, float x, float y, float z) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); + TEXTURE_RETURN_SHORT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex3D(texture texRef, float x, float y, float z) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); + TEXTURE_RETURN_SHORT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex3D(texture texRef, float x, float y, float z) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); + TEXTURE_RETURN_SHORT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex3D(texture texRef, float x, float y, float z) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); + TEXTURE_RETURN_USHORT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex3D(texture texRef, float x, float y, float z) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); + TEXTURE_RETURN_USHORT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex3D(texture texRef, float x, float y, float z) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); + TEXTURE_RETURN_USHORT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex3D(texture texRef, float x, float y, float z) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); + TEXTURE_RETURN_USHORT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int tex3D(texture texRef, float x, float y, float z) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); + TEXTURE_RETURN_INT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex3D(texture texRef, float x, float y, float z) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); + TEXTURE_RETURN_INT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex3D(texture texRef, float x, float y, float z) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); + TEXTURE_RETURN_INT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex3D(texture texRef, float x, float y, float z) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); + TEXTURE_RETURN_INT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex3D(texture texRef, float x, float y, float z) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); + TEXTURE_RETURN_UINT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex3D(texture texRef, float x, float y, float z) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); + TEXTURE_RETURN_UINT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex3D(texture texRef, float x, float y, float z) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); + TEXTURE_RETURN_UINT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex3D(texture texRef, float x, float y, float z) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); + TEXTURE_RETURN_UINT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float tex3D(texture texRef, float x, float y, float z) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); + TEXTURE_RETURN_FLOAT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex3D(texture texRef, float x, float y, float z) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); + TEXTURE_RETURN_FLOAT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex3D(texture texRef, float x, float y, float z) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); + TEXTURE_RETURN_FLOAT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex3D(texture texRef, float x, float y, float z) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector()); + TEXTURE_RETURN_FLOAT_XYZW; +} + +//////////////////////////////////////////////////////////// + template __TEXTURE_FUNCTIONS_DECL__ char tex3D(texture texRef, hipTextureObject_t textureObject, float x, float y, float z) { @@ -4860,6 +6755,168 @@ __TEXTURE_FUNCTIONS_DECL__ float4 tex3D(texture texRef, h //////////////////////////////////////////////////////////// +template +__TEXTURE_FUNCTIONS_DECL__ char tex3DLod(texture texRef, float x, float y, float z, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + TEXTURE_RETURN_CHAR; +} + +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex3DLod(texture texRef, float x, float y, float z, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + TEXTURE_RETURN_CHAR_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex3DLod(texture texRef, float x, float y, float z, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + TEXTURE_RETURN_CHAR_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex3DLod(texture texRef, float x, float y, float z, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + TEXTURE_RETURN_CHAR_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex3DLod(texture texRef, float x, float y, float z, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + TEXTURE_RETURN_UCHAR; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex3DLod(texture texRef, float x, float y, float z, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + TEXTURE_RETURN_UCHAR_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex3DLod(texture texRef, float x, float y, float z, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + TEXTURE_RETURN_UCHAR_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex3DLod(texture texRef, float x, float y, float z, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + TEXTURE_RETURN_UCHAR_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int tex3DLod(texture texRef, float x, float y, float z, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + TEXTURE_RETURN_INT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex3DLod(texture texRef, float x, float y, float z, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + TEXTURE_RETURN_INT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex3DLod(texture texRef, float x, float y, float z, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + TEXTURE_RETURN_INT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex3DLod(texture texRef, float x, float y, float z, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + TEXTURE_RETURN_INT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex3DLod(texture texRef, float x, float y, float z, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + TEXTURE_RETURN_UINT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex3DLod(texture texRef, float x, float y, float z, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + TEXTURE_RETURN_UINT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex3DLod(texture texRef, float x, float y, float z, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + TEXTURE_RETURN_UINT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex3DLod(texture texRef, float x, float y, float z, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + TEXTURE_RETURN_UINT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float tex3DLod(texture texRef, float x, float y, float z, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + TEXTURE_RETURN_FLOAT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex3DLod(texture texRef, float x, float y, float z, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + TEXTURE_RETURN_FLOAT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex3DLod(texture texRef, float x, float y, float z, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + TEXTURE_RETURN_FLOAT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex3DLod(texture texRef, float x, float y, float z, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_3D(i, s, hc::short_vector::float4(x, y, z, 0.0f).get_vector(), level); + TEXTURE_RETURN_FLOAT_XYZW; +} + +//////////////////////////////////////////////////////////// + template __TEXTURE_FUNCTIONS_DECL__ char tex3DLod(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float level) { @@ -5020,6 +7077,316 @@ __TEXTURE_FUNCTIONS_DECL__ float4 tex3DLod(texture texRef TEXTURE_RETURN_FLOAT_XYZW; } +//////////////////////////////////////////////////////////// + +template +__TEXTURE_FUNCTIONS_DECL__ char tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f =__ockl_image_sample_grad_3D(i, s, + hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + TEXTURE_RETURN_CHAR; +} + +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f =__ockl_image_sample_grad_3D(i, s, + hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + TEXTURE_RETURN_CHAR_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f =__ockl_image_sample_grad_3D(i, s, + hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + TEXTURE_RETURN_CHAR_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f =__ockl_image_sample_grad_3D(i, s, + hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + TEXTURE_RETURN_CHAR_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f =__ockl_image_sample_grad_3D(i, s, + hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + TEXTURE_RETURN_UCHAR; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f =__ockl_image_sample_grad_3D(i, s, + hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + TEXTURE_RETURN_UCHAR_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f =__ockl_image_sample_grad_3D(i, s, + hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + TEXTURE_RETURN_UCHAR_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f =__ockl_image_sample_grad_3D(i, s, + hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + TEXTURE_RETURN_UCHAR_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f =__ockl_image_sample_grad_3D(i, s, + hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + TEXTURE_RETURN_SHORT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f =__ockl_image_sample_grad_3D(i, s, + hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + TEXTURE_RETURN_SHORT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f =__ockl_image_sample_grad_3D(i, s, + hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + TEXTURE_RETURN_SHORT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f =__ockl_image_sample_grad_3D(i, s, + hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + TEXTURE_RETURN_SHORT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f =__ockl_image_sample_grad_3D(i, s, + hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + TEXTURE_RETURN_USHORT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f =__ockl_image_sample_grad_3D(i, s, + hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + TEXTURE_RETURN_USHORT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f =__ockl_image_sample_grad_3D(i, s, + hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + TEXTURE_RETURN_USHORT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f =__ockl_image_sample_grad_3D(i, s, + hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + TEXTURE_RETURN_USHORT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f =__ockl_image_sample_grad_3D(i, s, + hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + TEXTURE_RETURN_INT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f =__ockl_image_sample_grad_3D(i, s, + hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + TEXTURE_RETURN_INT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f =__ockl_image_sample_grad_3D(i, s, + hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + TEXTURE_RETURN_INT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f =__ockl_image_sample_grad_3D(i, s, + hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + TEXTURE_RETURN_INT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f =__ockl_image_sample_grad_3D(i, s, + hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + TEXTURE_RETURN_UINT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f =__ockl_image_sample_grad_3D(i, s, + hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + TEXTURE_RETURN_UINT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f =__ockl_image_sample_grad_3D(i, s, + hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + TEXTURE_RETURN_UINT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f =__ockl_image_sample_grad_3D(i, s, + hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + TEXTURE_RETURN_UINT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f =__ockl_image_sample_grad_3D(i, s, + hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + TEXTURE_RETURN_FLOAT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f =__ockl_image_sample_grad_3D(i, s, + hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + TEXTURE_RETURN_FLOAT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f =__ockl_image_sample_grad_3D(i, s, + hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + TEXTURE_RETURN_FLOAT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex3DGrad(texture texRef, float x, float y, float z, float4 dx, float4 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f =__ockl_image_sample_grad_3D(i, s, + hc::short_vector::float4(x, y, z, 0.0f).get_vector(), + hc::short_vector::float4(dx.x, dx.y, dx.z, dx.w).get_vector(), + hc::short_vector::float4(dy.x, dy.y, dy.z, dy.w).get_vector()); + TEXTURE_RETURN_FLOAT_XYZW; +} + //////////////////////////////////////////////////////////// template __TEXTURE_FUNCTIONS_DECL__ char tex3DGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, float z, float4 dx, float4 dy) @@ -5331,6 +7698,232 @@ __TEXTURE_FUNCTIONS_DECL__ float4 tex3DGrad(texture texRe //////////////////////////////////////////////////////////// +template +__TEXTURE_FUNCTIONS_DECL__ char tex1DLayered(texture texRef, float x, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); + TEXTURE_RETURN_CHAR; +} + +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex1DLayered(texture texRef, float x, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); + TEXTURE_RETURN_CHAR_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex1DLayered(texture texRef, float x, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); + TEXTURE_RETURN_CHAR_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex1DLayered(texture texRef, float x, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); + TEXTURE_RETURN_CHAR_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DLayered(texture texRef, float x, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); + TEXTURE_RETURN_UCHAR; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DLayered(texture texRef, float x, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); + TEXTURE_RETURN_UCHAR_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DLayered(texture texRef, float x, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); + TEXTURE_RETURN_UCHAR_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DLayered(texture texRef, float x, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); + TEXTURE_RETURN_UCHAR_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short tex1DLayered(texture texRef, float x, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); + TEXTURE_RETURN_SHORT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex1DLayered(texture texRef, float x, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); + TEXTURE_RETURN_SHORT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex1DLayered(texture texRef, float x, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); + TEXTURE_RETURN_SHORT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex1DLayered(texture texRef, float x, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); + TEXTURE_RETURN_SHORT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DLayered(texture texRef, float x, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); + TEXTURE_RETURN_USHORT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DLayered(texture texRef, float x, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); + TEXTURE_RETURN_USHORT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DLayered(texture texRef, float x, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); + TEXTURE_RETURN_USHORT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DLayered(texture texRef, float x, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); + TEXTURE_RETURN_USHORT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int tex1DLayered(texture texRef, float x, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); + TEXTURE_RETURN_INT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex1DLayered(texture texRef, float x, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); + TEXTURE_RETURN_INT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex1DLayered(texture texRef, float x, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); + TEXTURE_RETURN_INT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex1DLayered(texture texRef, float x, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); + TEXTURE_RETURN_INT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DLayered(texture texRef, float x, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); + TEXTURE_RETURN_UINT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex1DLayered(texture texRef, float x, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); + TEXTURE_RETURN_UINT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex1DLayered(texture texRef, float x, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); + TEXTURE_RETURN_UINT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex1DLayered(texture texRef, float x, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); + TEXTURE_RETURN_UINT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float tex1DLayered(texture texRef, float x, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); + TEXTURE_RETURN_FLOAT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex1DLayered(texture texRef, float x, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); + TEXTURE_RETURN_FLOAT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex1DLayered(texture texRef, float x, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); + TEXTURE_RETURN_FLOAT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex1DLayered(texture texRef, float x, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_1Da(i, s, hc::short_vector::float2(x, layer).get_vector()); + TEXTURE_RETURN_FLOAT_XYZW; +} + +//////////////////////////////////////////////////////////// + template __TEXTURE_FUNCTIONS_DECL__ char tex1DLayered(texture texRef, hipTextureObject_t textureObject, float x, int layer) { @@ -5557,6 +8150,232 @@ __TEXTURE_FUNCTIONS_DECL__ float4 tex1DLayered(texture te //////////////////////////////////////////////////////////// +template +__TEXTURE_FUNCTIONS_DECL__ char tex1DLayeredLod(texture texRef, float x, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + TEXTURE_RETURN_CHAR; +} + +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex1DLayeredLod(texture texRef, float x, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + TEXTURE_RETURN_CHAR_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex1DLayeredLod(texture texRef, float x, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + TEXTURE_RETURN_CHAR_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex1DLayeredLod(texture texRef, float x, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + TEXTURE_RETURN_CHAR_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DLayeredLod(texture texRef, float x, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + TEXTURE_RETURN_UCHAR; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DLayeredLod(texture texRef, float x, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + TEXTURE_RETURN_UCHAR_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DLayeredLod(texture texRef, float x, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + TEXTURE_RETURN_UCHAR_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DLayeredLod(texture texRef, float x, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + TEXTURE_RETURN_UCHAR_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short tex1DLayeredLod(texture texRef, float x, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + TEXTURE_RETURN_SHORT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex1DLayeredLod(texture texRef, float x, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + TEXTURE_RETURN_SHORT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex1DLayeredLod(texture texRef, float x, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + TEXTURE_RETURN_SHORT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex1DLayeredLod(texture texRef, float x, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + TEXTURE_RETURN_SHORT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DLayeredLod(texture texRef, float x, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + TEXTURE_RETURN_USHORT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DLayeredLod(texture texRef, float x, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + TEXTURE_RETURN_USHORT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DLayeredLod(texture texRef, float x, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + TEXTURE_RETURN_USHORT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DLayeredLod(texture texRef, float x, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + TEXTURE_RETURN_USHORT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int tex1DLayeredLod(texture texRef, float x, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + TEXTURE_RETURN_INT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex1DLayeredLod(texture texRef, float x, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + TEXTURE_RETURN_INT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex1DLayeredLod(texture texRef, float x, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + TEXTURE_RETURN_INT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex1DLayeredLod(texture texRef, float x, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + TEXTURE_RETURN_INT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DLayeredLod(texture texRef, float x, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + TEXTURE_RETURN_UINT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uint1 tex1DLayeredLod(texture texRef, float x, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + TEXTURE_RETURN_UINT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex1DLayeredLod(texture texRef, float x, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + TEXTURE_RETURN_UINT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex1DLayeredLod(texture texRef, float x, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + TEXTURE_RETURN_UINT_XYZW; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float tex1DLayeredLod(texture texRef, float x, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + TEXTURE_RETURN_FLOAT; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex1DLayeredLod(texture texRef, float x, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + TEXTURE_RETURN_FLOAT_X; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex1DLayeredLod(texture texRef, float x, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + TEXTURE_RETURN_FLOAT_XY; +} + +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex1DLayeredLod(texture texRef, float x, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), level); + TEXTURE_RETURN_FLOAT_XYZW; +} + +//////////////////////////////////////////////////////////// + template __TEXTURE_FUNCTIONS_DECL__ char tex1DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, int layer, float level) { @@ -5783,6 +8602,14 @@ __TEXTURE_FUNCTIONS_DECL__ float4 tex1DLayeredLod(texture //////////////////////////////////////////////////////////// +template +__TEXTURE_FUNCTIONS_DECL__ char tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + TEXTURE_RETURN_CHAR; +} + template __TEXTURE_FUNCTIONS_DECL__ char tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) { @@ -5791,6 +8618,14 @@ __TEXTURE_FUNCTIONS_DECL__ char tex1DLayeredGrad(texture te TEXTURE_RETURN_CHAR; } +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + TEXTURE_RETURN_CHAR_X; +} + template __TEXTURE_FUNCTIONS_DECL__ char1 tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) { @@ -5799,6 +8634,14 @@ __TEXTURE_FUNCTIONS_DECL__ char1 tex1DLayeredGrad(texture TEXTURE_RETURN_CHAR_X; } +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + TEXTURE_RETURN_CHAR_XY; +} + template __TEXTURE_FUNCTIONS_DECL__ char2 tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) { @@ -5807,6 +8650,14 @@ __TEXTURE_FUNCTIONS_DECL__ char2 tex1DLayeredGrad(texture TEXTURE_RETURN_CHAR_XY; } +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + TEXTURE_RETURN_CHAR_XYZW; +} + template __TEXTURE_FUNCTIONS_DECL__ char4 tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) { @@ -5815,6 +8666,14 @@ __TEXTURE_FUNCTIONS_DECL__ char4 tex1DLayeredGrad(texture TEXTURE_RETURN_CHAR_XYZW; } +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + TEXTURE_RETURN_UCHAR; +} + template __TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) { @@ -5823,6 +8682,14 @@ __TEXTURE_FUNCTIONS_DECL__ unsigned char tex1DLayeredGrad(texture +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + TEXTURE_RETURN_UCHAR_X; +} + template __TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) { @@ -5831,6 +8698,14 @@ __TEXTURE_FUNCTIONS_DECL__ uchar1 tex1DLayeredGrad(texture +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + TEXTURE_RETURN_UCHAR_XY; +} + template __TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) { @@ -5839,6 +8714,14 @@ __TEXTURE_FUNCTIONS_DECL__ uchar2 tex1DLayeredGrad(texture +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + TEXTURE_RETURN_UCHAR_XYZW; +} + template __TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) { @@ -5847,6 +8730,14 @@ __TEXTURE_FUNCTIONS_DECL__ uchar4 tex1DLayeredGrad(texture +__TEXTURE_FUNCTIONS_DECL__ short tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + TEXTURE_RETURN_SHORT; +} + template __TEXTURE_FUNCTIONS_DECL__ short tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) { @@ -5855,6 +8746,14 @@ __TEXTURE_FUNCTIONS_DECL__ short tex1DLayeredGrad(texture TEXTURE_RETURN_SHORT; } +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + TEXTURE_RETURN_SHORT_X; +} + template __TEXTURE_FUNCTIONS_DECL__ short1 tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) { @@ -5863,6 +8762,14 @@ __TEXTURE_FUNCTIONS_DECL__ short1 tex1DLayeredGrad(texture +__TEXTURE_FUNCTIONS_DECL__ short2 tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + TEXTURE_RETURN_SHORT_XY; +} + template __TEXTURE_FUNCTIONS_DECL__ short2 tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) { @@ -5871,6 +8778,14 @@ __TEXTURE_FUNCTIONS_DECL__ short2 tex1DLayeredGrad(texture +__TEXTURE_FUNCTIONS_DECL__ short4 tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + TEXTURE_RETURN_SHORT_XYZW; +} + template __TEXTURE_FUNCTIONS_DECL__ short4 tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) { @@ -5879,6 +8794,14 @@ __TEXTURE_FUNCTIONS_DECL__ short4 tex1DLayeredGrad(texture +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + TEXTURE_RETURN_USHORT; +} + template __TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) { @@ -5887,6 +8810,14 @@ __TEXTURE_FUNCTIONS_DECL__ unsigned short tex1DLayeredGrad(texture +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + TEXTURE_RETURN_USHORT_X; +} + template __TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) { @@ -5895,6 +8826,14 @@ __TEXTURE_FUNCTIONS_DECL__ ushort1 tex1DLayeredGrad(texture +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + TEXTURE_RETURN_USHORT_XY; +} + template __TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) { @@ -5903,6 +8842,14 @@ __TEXTURE_FUNCTIONS_DECL__ ushort2 tex1DLayeredGrad(texture +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + TEXTURE_RETURN_USHORT_XYZW; +} + template __TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) { @@ -5911,6 +8858,14 @@ __TEXTURE_FUNCTIONS_DECL__ ushort4 tex1DLayeredGrad(texture +__TEXTURE_FUNCTIONS_DECL__ int tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + TEXTURE_RETURN_INT; +} + template __TEXTURE_FUNCTIONS_DECL__ int tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) { @@ -5919,6 +8874,14 @@ __TEXTURE_FUNCTIONS_DECL__ int tex1DLayeredGrad(texture texR TEXTURE_RETURN_INT; } +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + TEXTURE_RETURN_INT_X; +} + template __TEXTURE_FUNCTIONS_DECL__ int1 tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) { @@ -5927,6 +8890,14 @@ __TEXTURE_FUNCTIONS_DECL__ int1 tex1DLayeredGrad(texture te TEXTURE_RETURN_INT_X; } +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + TEXTURE_RETURN_INT_XY; +} + template __TEXTURE_FUNCTIONS_DECL__ int2 tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) { @@ -5935,6 +8906,14 @@ __TEXTURE_FUNCTIONS_DECL__ int2 tex1DLayeredGrad(texture te TEXTURE_RETURN_INT_XY; } +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + TEXTURE_RETURN_INT_XYZW; +} + template __TEXTURE_FUNCTIONS_DECL__ int4 tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) { @@ -5943,6 +8922,14 @@ __TEXTURE_FUNCTIONS_DECL__ int4 tex1DLayeredGrad(texture te TEXTURE_RETURN_INT_XYZW; } +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + TEXTURE_RETURN_UINT; +} + template __TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) { @@ -5951,6 +8938,14 @@ __TEXTURE_FUNCTIONS_DECL__ unsigned int tex1DLayeredGrad(texture +__TEXTURE_FUNCTIONS_DECL__ uint1 tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + TEXTURE_RETURN_UINT_X; +} + template __TEXTURE_FUNCTIONS_DECL__ uint1 tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) { @@ -5959,6 +8954,14 @@ __TEXTURE_FUNCTIONS_DECL__ uint1 tex1DLayeredGrad(texture TEXTURE_RETURN_UINT_X; } +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + TEXTURE_RETURN_UINT_XY; +} + template __TEXTURE_FUNCTIONS_DECL__ uint2 tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) { @@ -5967,6 +8970,14 @@ __TEXTURE_FUNCTIONS_DECL__ uint2 tex1DLayeredGrad(texture TEXTURE_RETURN_UINT_XY; } +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + TEXTURE_RETURN_UINT_XYZW; +} + template __TEXTURE_FUNCTIONS_DECL__ uint4 tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) { @@ -5975,6 +8986,14 @@ __TEXTURE_FUNCTIONS_DECL__ uint4 tex1DLayeredGrad(texture TEXTURE_RETURN_UINT_XYZW; } +template +__TEXTURE_FUNCTIONS_DECL__ float tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + TEXTURE_RETURN_FLOAT; +} + template __TEXTURE_FUNCTIONS_DECL__ float tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) { @@ -5983,6 +9002,14 @@ __TEXTURE_FUNCTIONS_DECL__ float tex1DLayeredGrad(texture TEXTURE_RETURN_FLOAT; } +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + TEXTURE_RETURN_FLOAT_X; +} + template __TEXTURE_FUNCTIONS_DECL__ float1 tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) { @@ -5991,6 +9018,14 @@ __TEXTURE_FUNCTIONS_DECL__ float1 tex1DLayeredGrad(texture +__TEXTURE_FUNCTIONS_DECL__ float2 tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + TEXTURE_RETURN_FLOAT_XY; +} + template __TEXTURE_FUNCTIONS_DECL__ float2 tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) { @@ -5999,6 +9034,14 @@ __TEXTURE_FUNCTIONS_DECL__ float2 tex1DLayeredGrad(texture +__TEXTURE_FUNCTIONS_DECL__ float4 tex1DLayeredGrad(texture texRef, float x, int layer, float dx, float dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_1Da(i, s, hc::short_vector::float2(x, layer).get_vector(), dx, dy); + TEXTURE_RETURN_FLOAT_XYZW; +} + template __TEXTURE_FUNCTIONS_DECL__ float4 tex1DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, int layer, float dx, float dy) { @@ -6009,6 +9052,14 @@ __TEXTURE_FUNCTIONS_DECL__ float4 tex1DLayeredGrad(texture +__TEXTURE_FUNCTIONS_DECL__ char tex2DLayered(texture texRef, float x, float y, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + TEXTURE_RETURN_CHAR; +} + template __TEXTURE_FUNCTIONS_DECL__ char tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) { @@ -6017,6 +9068,14 @@ __TEXTURE_FUNCTIONS_DECL__ char tex2DLayered(texture texRef TEXTURE_RETURN_CHAR; } +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex2DLayered(texture texRef, float x, float y, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + TEXTURE_RETURN_CHAR_X; +} + template __TEXTURE_FUNCTIONS_DECL__ char1 tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) { @@ -6025,6 +9084,14 @@ __TEXTURE_FUNCTIONS_DECL__ char1 tex2DLayered(texture texR TEXTURE_RETURN_CHAR_X; } +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex2DLayered(texture texRef, float x, float y, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + TEXTURE_RETURN_CHAR_XY; +} + template __TEXTURE_FUNCTIONS_DECL__ char2 tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) { @@ -6033,6 +9100,14 @@ __TEXTURE_FUNCTIONS_DECL__ char2 tex2DLayered(texture texR TEXTURE_RETURN_CHAR_XY; } +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex2DLayered(texture texRef, float x, float y, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + TEXTURE_RETURN_CHAR_XYZW; +} + template __TEXTURE_FUNCTIONS_DECL__ char4 tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) { @@ -6041,6 +9116,14 @@ __TEXTURE_FUNCTIONS_DECL__ char4 tex2DLayered(texture texR TEXTURE_RETURN_CHAR_XYZW; } +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DLayered(texture texRef, float x, float y, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + TEXTURE_RETURN_UCHAR; +} + template __TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) { @@ -6049,6 +9132,14 @@ __TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DLayered(texture +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DLayered(texture texRef, float x, float y, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + TEXTURE_RETURN_UCHAR_X; +} + template __TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) { @@ -6057,6 +9148,14 @@ __TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DLayered(texture te TEXTURE_RETURN_UCHAR_X; } +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DLayered(texture texRef, float x, float y, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + TEXTURE_RETURN_UCHAR_XY; +} + template __TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) { @@ -6065,6 +9164,14 @@ __TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DLayered(texture te TEXTURE_RETURN_UCHAR_XY; } +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DLayered(texture texRef, float x, float y, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + TEXTURE_RETURN_UCHAR_XYZW; +} + template __TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) { @@ -6073,6 +9180,14 @@ __TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DLayered(texture te TEXTURE_RETURN_UCHAR_XYZW; } +template +__TEXTURE_FUNCTIONS_DECL__ short tex2DLayered(texture texRef, float x, float y, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + TEXTURE_RETURN_SHORT; +} + template __TEXTURE_FUNCTIONS_DECL__ short tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) { @@ -6081,6 +9196,14 @@ __TEXTURE_FUNCTIONS_DECL__ short tex2DLayered(texture texR TEXTURE_RETURN_SHORT; } +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex2DLayered(texture texRef, float x, float y, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + TEXTURE_RETURN_SHORT_X; +} + template __TEXTURE_FUNCTIONS_DECL__ short1 tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) { @@ -6089,6 +9212,14 @@ __TEXTURE_FUNCTIONS_DECL__ short1 tex2DLayered(texture te TEXTURE_RETURN_SHORT_X; } +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex2DLayered(texture texRef, float x, float y, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + TEXTURE_RETURN_SHORT_XY; +} + template __TEXTURE_FUNCTIONS_DECL__ short2 tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) { @@ -6097,6 +9228,14 @@ __TEXTURE_FUNCTIONS_DECL__ short2 tex2DLayered(texture te TEXTURE_RETURN_SHORT_XY; } +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex2DLayered(texture texRef, float x, float y, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + TEXTURE_RETURN_SHORT_XYZW; +} + template __TEXTURE_FUNCTIONS_DECL__ short4 tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) { @@ -6105,6 +9244,14 @@ __TEXTURE_FUNCTIONS_DECL__ short4 tex2DLayered(texture te TEXTURE_RETURN_SHORT_XYZW; } +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DLayered(texture texRef, float x, float y, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + TEXTURE_RETURN_USHORT; +} + template __TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) { @@ -6113,6 +9260,14 @@ __TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DLayered(texture +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DLayered(texture texRef, float x, float y, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + TEXTURE_RETURN_USHORT_X; +} + template __TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) { @@ -6121,6 +9276,14 @@ __TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DLayered(texture TEXTURE_RETURN_USHORT_X; } +template +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DLayered(texture texRef, float x, float y, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + TEXTURE_RETURN_USHORT_XY; +} + template __TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) { @@ -6129,6 +9292,14 @@ __TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DLayered(texture TEXTURE_RETURN_USHORT_XY; } +template +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DLayered(texture texRef, float x, float y, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + TEXTURE_RETURN_USHORT_XYZW; +} + template __TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) { @@ -6137,6 +9308,14 @@ __TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DLayered(texture TEXTURE_RETURN_USHORT_XYZW; } +template +__TEXTURE_FUNCTIONS_DECL__ int tex2DLayered(texture texRef, float x, float y, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + TEXTURE_RETURN_INT; +} + template __TEXTURE_FUNCTIONS_DECL__ int tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) { @@ -6145,6 +9324,14 @@ __TEXTURE_FUNCTIONS_DECL__ int tex2DLayered(texture texRef, TEXTURE_RETURN_INT; } +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex2DLayered(texture texRef, float x, float y, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + TEXTURE_RETURN_INT_X; +} + template __TEXTURE_FUNCTIONS_DECL__ int1 tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) { @@ -6153,6 +9340,14 @@ __TEXTURE_FUNCTIONS_DECL__ int1 tex2DLayered(texture texRef TEXTURE_RETURN_INT_X; } +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex2DLayered(texture texRef, float x, float y, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + TEXTURE_RETURN_INT_XY; +} + template __TEXTURE_FUNCTIONS_DECL__ int2 tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) { @@ -6161,6 +9356,14 @@ __TEXTURE_FUNCTIONS_DECL__ int2 tex2DLayered(texture texRef TEXTURE_RETURN_INT_XY; } +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex2DLayered(texture texRef, float x, float y, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + TEXTURE_RETURN_INT_XYZW; +} + template __TEXTURE_FUNCTIONS_DECL__ int4 tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) { @@ -6169,6 +9372,14 @@ __TEXTURE_FUNCTIONS_DECL__ int4 tex2DLayered(texture texRef TEXTURE_RETURN_INT_XYZW; } +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DLayered(texture texRef, float x, float y, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + TEXTURE_RETURN_UINT; +} + template __TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) { @@ -6177,6 +9388,14 @@ __TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DLayered(texture +__TEXTURE_FUNCTIONS_DECL__ uint1 tex2DLayered(texture texRef, float x, float y, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + TEXTURE_RETURN_UINT_X; +} + template __TEXTURE_FUNCTIONS_DECL__ uint1 tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) { @@ -6185,6 +9404,14 @@ __TEXTURE_FUNCTIONS_DECL__ uint1 tex2DLayered(texture texR TEXTURE_RETURN_UINT_X; } +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex2DLayered(texture texRef, float x, float y, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + TEXTURE_RETURN_UINT_XY; +} + template __TEXTURE_FUNCTIONS_DECL__ uint2 tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) { @@ -6193,6 +9420,14 @@ __TEXTURE_FUNCTIONS_DECL__ uint2 tex2DLayered(texture texR TEXTURE_RETURN_UINT_XY; } +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex2DLayered(texture texRef, float x, float y, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + TEXTURE_RETURN_UINT_XYZW; +} + template __TEXTURE_FUNCTIONS_DECL__ uint4 tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) { @@ -6201,6 +9436,14 @@ __TEXTURE_FUNCTIONS_DECL__ uint4 tex2DLayered(texture texR TEXTURE_RETURN_UINT_XYZW; } +template +__TEXTURE_FUNCTIONS_DECL__ float tex2DLayered(texture texRef, float x, float y, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + TEXTURE_RETURN_FLOAT; +} + template __TEXTURE_FUNCTIONS_DECL__ float tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) { @@ -6209,6 +9452,14 @@ __TEXTURE_FUNCTIONS_DECL__ float tex2DLayered(texture texR TEXTURE_RETURN_FLOAT; } +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex2DLayered(texture texRef, float x, float y, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + TEXTURE_RETURN_FLOAT_X; +} + template __TEXTURE_FUNCTIONS_DECL__ float1 tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) { @@ -6217,6 +9468,14 @@ __TEXTURE_FUNCTIONS_DECL__ float1 tex2DLayered(texture te TEXTURE_RETURN_FLOAT_X; } +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex2DLayered(texture texRef, float x, float y, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + TEXTURE_RETURN_FLOAT_XY; +} + template __TEXTURE_FUNCTIONS_DECL__ float2 tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) { @@ -6225,6 +9484,14 @@ __TEXTURE_FUNCTIONS_DECL__ float2 tex2DLayered(texture te TEXTURE_RETURN_FLOAT_XY; } +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex2DLayered(texture texRef, float x, float y, int layer) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector()); + TEXTURE_RETURN_FLOAT_XYZW; +} + template __TEXTURE_FUNCTIONS_DECL__ float4 tex2DLayered(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer) { @@ -6235,6 +9502,14 @@ __TEXTURE_FUNCTIONS_DECL__ float4 tex2DLayered(texture te //////////////////////////////////////////////////////////// +template +__TEXTURE_FUNCTIONS_DECL__ char tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + TEXTURE_RETURN_CHAR; +} + template __TEXTURE_FUNCTIONS_DECL__ char tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) { @@ -6243,6 +9518,14 @@ __TEXTURE_FUNCTIONS_DECL__ char tex2DLayeredLod(texture tex TEXTURE_RETURN_CHAR; } +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + TEXTURE_RETURN_CHAR_X; +} + template __TEXTURE_FUNCTIONS_DECL__ char1 tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) { @@ -6251,6 +9534,14 @@ __TEXTURE_FUNCTIONS_DECL__ char1 tex2DLayeredLod(texture t TEXTURE_RETURN_CHAR_X; } +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + TEXTURE_RETURN_CHAR_XY; +} + template __TEXTURE_FUNCTIONS_DECL__ char2 tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) { @@ -6259,6 +9550,14 @@ __TEXTURE_FUNCTIONS_DECL__ char2 tex2DLayeredLod(texture t TEXTURE_RETURN_CHAR_XY; } +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + TEXTURE_RETURN_CHAR_XYZW; +} + template __TEXTURE_FUNCTIONS_DECL__ char4 tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) { @@ -6267,6 +9566,14 @@ __TEXTURE_FUNCTIONS_DECL__ char4 tex2DLayeredLod(texture t TEXTURE_RETURN_CHAR_XYZW; } +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + TEXTURE_RETURN_UCHAR; +} + template __TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) { @@ -6275,6 +9582,14 @@ __TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DLayeredLod(texture +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + TEXTURE_RETURN_UCHAR_X; +} + template __TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) { @@ -6283,6 +9598,14 @@ __TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DLayeredLod(texture TEXTURE_RETURN_UCHAR_X; } +template +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + TEXTURE_RETURN_UCHAR_XY; +} + template __TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) { @@ -6291,6 +9614,14 @@ __TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DLayeredLod(texture TEXTURE_RETURN_UCHAR_XY; } +template +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + TEXTURE_RETURN_UCHAR_XYZW; +} + template __TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) { @@ -6299,6 +9630,14 @@ __TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DLayeredLod(texture TEXTURE_RETURN_UCHAR_XYZW; } +template +__TEXTURE_FUNCTIONS_DECL__ short tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + TEXTURE_RETURN_SHORT; +} + template __TEXTURE_FUNCTIONS_DECL__ short tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) { @@ -6307,6 +9646,14 @@ __TEXTURE_FUNCTIONS_DECL__ short tex2DLayeredLod(texture t TEXTURE_RETURN_SHORT; } +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + TEXTURE_RETURN_SHORT_X; +} + template __TEXTURE_FUNCTIONS_DECL__ short1 tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) { @@ -6315,6 +9662,14 @@ __TEXTURE_FUNCTIONS_DECL__ short1 tex2DLayeredLod(texture TEXTURE_RETURN_SHORT_X; } +template +__TEXTURE_FUNCTIONS_DECL__ short2 tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + TEXTURE_RETURN_SHORT_XY; +} + template __TEXTURE_FUNCTIONS_DECL__ short2 tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) { @@ -6323,6 +9678,14 @@ __TEXTURE_FUNCTIONS_DECL__ short2 tex2DLayeredLod(texture TEXTURE_RETURN_SHORT_XY; } +template +__TEXTURE_FUNCTIONS_DECL__ short4 tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + TEXTURE_RETURN_SHORT_XYZW; +} + template __TEXTURE_FUNCTIONS_DECL__ short4 tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) { @@ -6331,6 +9694,14 @@ __TEXTURE_FUNCTIONS_DECL__ short4 tex2DLayeredLod(texture TEXTURE_RETURN_SHORT_XYZW; } +template +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + TEXTURE_RETURN_USHORT; +} + template __TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) { @@ -6339,6 +9710,14 @@ __TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DLayeredLod(texture +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + TEXTURE_RETURN_USHORT_X; +} + template __TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) { @@ -6347,6 +9726,14 @@ __TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DLayeredLod(texture +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + TEXTURE_RETURN_USHORT_XY; +} + template __TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) { @@ -6355,6 +9742,14 @@ __TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DLayeredLod(texture +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + TEXTURE_RETURN_USHORT_XYZW; +} + template __TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) { @@ -6363,6 +9758,14 @@ __TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DLayeredLod(texture +__TEXTURE_FUNCTIONS_DECL__ int tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + TEXTURE_RETURN_INT; +} + template __TEXTURE_FUNCTIONS_DECL__ int tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) { @@ -6371,6 +9774,14 @@ __TEXTURE_FUNCTIONS_DECL__ int tex2DLayeredLod(texture texRe TEXTURE_RETURN_INT; } +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + TEXTURE_RETURN_INT_X; +} + template __TEXTURE_FUNCTIONS_DECL__ int1 tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) { @@ -6379,6 +9790,14 @@ __TEXTURE_FUNCTIONS_DECL__ int1 tex2DLayeredLod(texture tex TEXTURE_RETURN_INT_X; } +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + TEXTURE_RETURN_INT_XY; +} + template __TEXTURE_FUNCTIONS_DECL__ int2 tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) { @@ -6387,6 +9806,14 @@ __TEXTURE_FUNCTIONS_DECL__ int2 tex2DLayeredLod(texture tex TEXTURE_RETURN_INT_XY; } +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + TEXTURE_RETURN_INT_XYZW; +} + template __TEXTURE_FUNCTIONS_DECL__ int4 tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) { @@ -6395,6 +9822,14 @@ __TEXTURE_FUNCTIONS_DECL__ int4 tex2DLayeredLod(texture tex TEXTURE_RETURN_INT_XYZW; } +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + TEXTURE_RETURN_UINT; +} + template __TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) { @@ -6403,6 +9838,14 @@ __TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DLayeredLod(texture +__TEXTURE_FUNCTIONS_DECL__ uint1 tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + TEXTURE_RETURN_UINT_X; +} + template __TEXTURE_FUNCTIONS_DECL__ uint1 tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) { @@ -6411,6 +9854,14 @@ __TEXTURE_FUNCTIONS_DECL__ uint1 tex2DLayeredLod(texture t TEXTURE_RETURN_UINT_X; } +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + TEXTURE_RETURN_UINT_XY; +} + template __TEXTURE_FUNCTIONS_DECL__ uint2 tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) { @@ -6419,6 +9870,14 @@ __TEXTURE_FUNCTIONS_DECL__ uint2 tex2DLayeredLod(texture t TEXTURE_RETURN_UINT_XY; } +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + TEXTURE_RETURN_UINT_XYZW; +} + template __TEXTURE_FUNCTIONS_DECL__ uint4 tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) { @@ -6427,6 +9886,14 @@ __TEXTURE_FUNCTIONS_DECL__ uint4 tex2DLayeredLod(texture t TEXTURE_RETURN_UINT_XYZW; } +template +__TEXTURE_FUNCTIONS_DECL__ float tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + TEXTURE_RETURN_FLOAT; +} + template __TEXTURE_FUNCTIONS_DECL__ float tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) { @@ -6435,6 +9902,14 @@ __TEXTURE_FUNCTIONS_DECL__ float tex2DLayeredLod(texture t TEXTURE_RETURN_FLOAT; } +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + TEXTURE_RETURN_FLOAT_X; +} + template __TEXTURE_FUNCTIONS_DECL__ float1 tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) { @@ -6443,6 +9918,14 @@ __TEXTURE_FUNCTIONS_DECL__ float1 tex2DLayeredLod(texture TEXTURE_RETURN_FLOAT_X; } +template +__TEXTURE_FUNCTIONS_DECL__ float2 tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + TEXTURE_RETURN_FLOAT_XY; +} + template __TEXTURE_FUNCTIONS_DECL__ float2 tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) { @@ -6451,6 +9934,14 @@ __TEXTURE_FUNCTIONS_DECL__ float2 tex2DLayeredLod(texture TEXTURE_RETURN_FLOAT_XY; } +template +__TEXTURE_FUNCTIONS_DECL__ float4 tex2DLayeredLod(texture texRef, float x, float y, int layer, float level) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_lod_2Da(i, s, hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), level); + TEXTURE_RETURN_FLOAT_XYZW; +} + template __TEXTURE_FUNCTIONS_DECL__ float4 tex2DLayeredLod(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float level) { @@ -6461,6 +9952,17 @@ __TEXTURE_FUNCTIONS_DECL__ float4 tex2DLayeredLod(texture //////////////////////////////////////////////////////////// +template +__TEXTURE_FUNCTIONS_DECL__ char tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2Da(i, s, + hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_CHAR; +} + template __TEXTURE_FUNCTIONS_DECL__ char tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) { @@ -6472,6 +9974,17 @@ __TEXTURE_FUNCTIONS_DECL__ char tex2DLayeredGrad(texture te TEXTURE_RETURN_CHAR; } +template +__TEXTURE_FUNCTIONS_DECL__ char1 tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2Da(i, s, + hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_CHAR_X; +} + template __TEXTURE_FUNCTIONS_DECL__ char1 tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) { @@ -6483,6 +9996,17 @@ __TEXTURE_FUNCTIONS_DECL__ char1 tex2DLayeredGrad(texture TEXTURE_RETURN_CHAR_X; } +template +__TEXTURE_FUNCTIONS_DECL__ char2 tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2Da(i, s, + hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_CHAR_XY; +} + template __TEXTURE_FUNCTIONS_DECL__ char2 tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) { @@ -6494,6 +10018,17 @@ __TEXTURE_FUNCTIONS_DECL__ char2 tex2DLayeredGrad(texture TEXTURE_RETURN_CHAR_XY; } +template +__TEXTURE_FUNCTIONS_DECL__ char4 tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2Da(i, s, + hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_CHAR_XYZW; +} + template __TEXTURE_FUNCTIONS_DECL__ char4 tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) { @@ -6505,6 +10040,17 @@ __TEXTURE_FUNCTIONS_DECL__ char4 tex2DLayeredGrad(texture TEXTURE_RETURN_CHAR_XYZW; } +template +__TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2Da(i, s, + hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_UCHAR; +} + template __TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) { @@ -6516,6 +10062,17 @@ __TEXTURE_FUNCTIONS_DECL__ unsigned char tex2DLayeredGrad(texture +__TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2Da(i, s, + hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_UCHAR_X; +} + template __TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) { @@ -6527,6 +10084,17 @@ __TEXTURE_FUNCTIONS_DECL__ uchar1 tex2DLayeredGrad(texture +__TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2Da(i, s, + hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_UCHAR_XY; +} + template __TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) { @@ -6538,6 +10106,17 @@ __TEXTURE_FUNCTIONS_DECL__ uchar2 tex2DLayeredGrad(texture +__TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2Da(i, s, + hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_UCHAR_XYZW; +} + template __TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) { @@ -6549,6 +10128,17 @@ __TEXTURE_FUNCTIONS_DECL__ uchar4 tex2DLayeredGrad(texture +__TEXTURE_FUNCTIONS_DECL__ short tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2Da(i, s, + hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_SHORT; +} + template __TEXTURE_FUNCTIONS_DECL__ short tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) { @@ -6560,6 +10150,17 @@ __TEXTURE_FUNCTIONS_DECL__ short tex2DLayeredGrad(texture TEXTURE_RETURN_SHORT; } +template +__TEXTURE_FUNCTIONS_DECL__ short1 tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2Da(i, s, + hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_SHORT_X; +} + template __TEXTURE_FUNCTIONS_DECL__ short1 tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) { @@ -6571,6 +10172,17 @@ __TEXTURE_FUNCTIONS_DECL__ short1 tex2DLayeredGrad(texture +__TEXTURE_FUNCTIONS_DECL__ short2 tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2Da(i, s, + hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_SHORT_XY; +} + template __TEXTURE_FUNCTIONS_DECL__ short2 tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) { @@ -6582,6 +10194,17 @@ __TEXTURE_FUNCTIONS_DECL__ short2 tex2DLayeredGrad(texture +__TEXTURE_FUNCTIONS_DECL__ short4 tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2Da(i, s, + hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_SHORT_XYZW; +} + template __TEXTURE_FUNCTIONS_DECL__ short4 tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) { @@ -6593,6 +10216,17 @@ __TEXTURE_FUNCTIONS_DECL__ short4 tex2DLayeredGrad(texture +__TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2Da(i, s, + hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_USHORT; +} + template __TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) { @@ -6604,6 +10238,17 @@ __TEXTURE_FUNCTIONS_DECL__ unsigned short tex2DLayeredGrad(texture +__TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2Da(i, s, + hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_USHORT_X; +} + template __TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) { @@ -6615,6 +10260,17 @@ __TEXTURE_FUNCTIONS_DECL__ ushort1 tex2DLayeredGrad(texture +__TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2Da(i, s, + hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_USHORT_XY; +} + template __TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) { @@ -6626,6 +10282,17 @@ __TEXTURE_FUNCTIONS_DECL__ ushort2 tex2DLayeredGrad(texture +__TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2Da(i, s, + hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_USHORT_XYZW; +} + template __TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) { @@ -6637,6 +10304,17 @@ __TEXTURE_FUNCTIONS_DECL__ ushort4 tex2DLayeredGrad(texture +__TEXTURE_FUNCTIONS_DECL__ int tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2Da(i, s, + hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_INT; +} + template __TEXTURE_FUNCTIONS_DECL__ int tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) { @@ -6648,6 +10326,17 @@ __TEXTURE_FUNCTIONS_DECL__ int tex2DLayeredGrad(texture texR TEXTURE_RETURN_INT; } +template +__TEXTURE_FUNCTIONS_DECL__ int1 tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2Da(i, s, + hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_INT_X; +} + template __TEXTURE_FUNCTIONS_DECL__ int1 tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) { @@ -6659,6 +10348,17 @@ __TEXTURE_FUNCTIONS_DECL__ int1 tex2DLayeredGrad(texture te TEXTURE_RETURN_INT_X; } +template +__TEXTURE_FUNCTIONS_DECL__ int2 tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2Da(i, s, + hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_INT_XY; +} + template __TEXTURE_FUNCTIONS_DECL__ int2 tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) { @@ -6670,6 +10370,17 @@ __TEXTURE_FUNCTIONS_DECL__ int2 tex2DLayeredGrad(texture te TEXTURE_RETURN_INT_XY; } +template +__TEXTURE_FUNCTIONS_DECL__ int4 tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2Da(i, s, + hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_INT_XYZW; +} + template __TEXTURE_FUNCTIONS_DECL__ int4 tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) { @@ -6681,6 +10392,17 @@ __TEXTURE_FUNCTIONS_DECL__ int4 tex2DLayeredGrad(texture te TEXTURE_RETURN_INT_XYZW; } +template +__TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2Da(i, s, + hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_UINT; +} + template __TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) { @@ -6692,6 +10414,17 @@ __TEXTURE_FUNCTIONS_DECL__ unsigned int tex2DLayeredGrad(texture +__TEXTURE_FUNCTIONS_DECL__ uint1 tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2Da(i, s, + hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_UINT_X; +} + template __TEXTURE_FUNCTIONS_DECL__ uint1 tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) { @@ -6703,6 +10436,17 @@ __TEXTURE_FUNCTIONS_DECL__ uint1 tex2DLayeredGrad(texture TEXTURE_RETURN_UINT_X; } +template +__TEXTURE_FUNCTIONS_DECL__ uint2 tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2Da(i, s, + hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_UINT_XY; +} + template __TEXTURE_FUNCTIONS_DECL__ uint2 tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) { @@ -6714,6 +10458,17 @@ __TEXTURE_FUNCTIONS_DECL__ uint2 tex2DLayeredGrad(texture TEXTURE_RETURN_UINT_XY; } +template +__TEXTURE_FUNCTIONS_DECL__ uint4 tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2Da(i, s, + hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_UINT_XYZW; +} + template __TEXTURE_FUNCTIONS_DECL__ uint4 tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) { @@ -6725,6 +10480,17 @@ __TEXTURE_FUNCTIONS_DECL__ uint4 tex2DLayeredGrad(texture TEXTURE_RETURN_UINT_XYZW; } +template +__TEXTURE_FUNCTIONS_DECL__ float tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2Da(i, s, + hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_FLOAT; +} + template __TEXTURE_FUNCTIONS_DECL__ float tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) { @@ -6736,6 +10502,17 @@ __TEXTURE_FUNCTIONS_DECL__ float tex2DLayeredGrad(texture TEXTURE_RETURN_FLOAT; } +template +__TEXTURE_FUNCTIONS_DECL__ float1 tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2Da(i, s, + hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_FLOAT_X; +} + template __TEXTURE_FUNCTIONS_DECL__ float1 tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) { @@ -6747,6 +10524,17 @@ __TEXTURE_FUNCTIONS_DECL__ float1 tex2DLayeredGrad(texture +__TEXTURE_FUNCTIONS_DECL__ float2 tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2Da(i, s, + hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_FLOAT_XY; +} + template __TEXTURE_FUNCTIONS_DECL__ float2 tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) { @@ -6758,6 +10546,17 @@ __TEXTURE_FUNCTIONS_DECL__ float2 tex2DLayeredGrad(texture +__TEXTURE_FUNCTIONS_DECL__ float4 tex2DLayeredGrad(texture texRef, float x, float y, int layer, float2 dx, float2 dy) +{ + TEXTURE_REF_PARAMETERS_INIT; + texel.f = __ockl_image_sample_grad_2Da(i, s, + hc::short_vector::float4(x, y, layer, 0.0f).get_vector(), + hc::short_vector::float2(dx.x, dx.y).get_vector(), + hc::short_vector::float2(dy.x, dy.y).get_vector()); + TEXTURE_RETURN_FLOAT_XYZW; +} + template __TEXTURE_FUNCTIONS_DECL__ float4 tex2DLayeredGrad(texture texRef, hipTextureObject_t textureObject, float x, float y, int layer, float2 dx, float2 dy) { diff --git a/hipamd/include/hip/hcc_detail/texture_types.h b/hipamd/include/hip/hcc_detail/texture_types.h index 731ed12308..0a99abe451 100644 --- a/hipamd/include/hip/hcc_detail/texture_types.h +++ b/hipamd/include/hip/hcc_detail/texture_types.h @@ -93,6 +93,8 @@ struct textureReference float maxMipmapLevelClamp; hipTextureObject_t textureObject; + int numChannels; + enum hipArray_Format format; }; /** diff --git a/hipamd/include/hip/hip_runtime_api.h b/hipamd/include/hip/hip_runtime_api.h index a2ebcd27a5..f764599164 100644 --- a/hipamd/include/hip/hip_runtime_api.h +++ b/hipamd/include/hip/hip_runtime_api.h @@ -116,8 +116,10 @@ typedef struct hipDeviceProp_t { * Memory type (for pointer attributes) */ enum hipMemoryType { - hipMemoryTypeHost, ///< Memory is physically located on host - hipMemoryTypeDevice ///< Memory is physically located on device. (see deviceId for specific device) + hipMemoryTypeHost, ///< Memory is physically located on host + hipMemoryTypeDevice, ///< Memory is physically located on device. (see deviceId for specific device) + hipMemoryTypeArray, ///< Array memory, physically located on device. (see deviceId for specific device) + hipMemoryTypeUnified ///< Not used currently }; diff --git a/hipamd/samples/2_Cookbook/11_texture_driver/Makefile b/hipamd/samples/2_Cookbook/11_texture_driver/Makefile new file mode 100644 index 0000000000..b68c5c31c7 --- /dev/null +++ b/hipamd/samples/2_Cookbook/11_texture_driver/Makefile @@ -0,0 +1,17 @@ +HIP_PATH?= $(wildcard /opt/rocm/hip) +ifeq (,$(HIP_PATH)) + HIP_PATH=../../.. +endif +HIPCC=$(HIP_PATH)/bin/hipcc +HIP_PLATFORM=$(shell $(HIP_PATH)/bin/hipconfig --compiler) + +all: tex2dKernel.code texture2dDrv.out + +texture2dDrv.out: texture2dDrv.cpp + $(HIPCC) $(HIPCC_FLAGS) $< -o $@ + +tex2dKernel.code: tex2dKernel.cpp + $(HIPCC) --genco $(GENCO_FLAGS) $^ -o $@ + +clean: + rm -f *.code *.out diff --git a/hipamd/samples/2_Cookbook/11_texture_driver/tex2dKernel.cpp b/hipamd/samples/2_Cookbook/11_texture_driver/tex2dKernel.cpp new file mode 100644 index 0000000000..17ed911808 --- /dev/null +++ b/hipamd/samples/2_Cookbook/11_texture_driver/tex2dKernel.cpp @@ -0,0 +1,33 @@ +/* +Copyright (c) 2015 - present Advanced Micro Devices, Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + +#include "hip/hip_runtime.h" +extern texture tex; + +__global__ void tex2dKernel(hipLaunchParm lp, float* outputData, + int width, + int height) +{ + int x = hipBlockIdx_x*hipBlockDim_x + hipThreadIdx_x; + int y = hipBlockIdx_y*hipBlockDim_y + hipThreadIdx_y; + outputData[y*width + x] = tex2D(tex, x, y); +} diff --git a/hipamd/samples/2_Cookbook/11_texture_driver/texture2dDrv.cpp b/hipamd/samples/2_Cookbook/11_texture_driver/texture2dDrv.cpp new file mode 100644 index 0000000000..a19f4376c3 --- /dev/null +++ b/hipamd/samples/2_Cookbook/11_texture_driver/texture2dDrv.cpp @@ -0,0 +1,156 @@ +/* +Copyright (c) 2015 - present Advanced Micro Devices, Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + +#include "hip/hip_runtime.h" +#include "hip/hip_runtime_api.h" +#include +#include +#include +#include + +#define fileName "tex2dKernel.code" + +texture tex; +bool testResult = false; + +#define HIP_CHECK(cmd) \ +{\ + hipError_t status = cmd;\ + if(status != hipSuccess) {std::cout<<"error: #"<