// Copyright (c) 2012-2017 VideoStitch SAS // Copyright (c) 2018 stitchEm #include "gpu/image/imageOps.hpp" #include "cuda/util.hpp" #include "../deviceBuffer.hpp" #include "../deviceStream.hpp" #include "../gpuKernelDef.h" #include namespace VideoStitch { namespace Image { Status flip(GPU::Buffer dst, GPU::Buffer src, size_t length, GPU::Stream stream) { dim3 dimBlock(16, 16, 1); dim3 dimGrid((unsigned)Cuda::ceilDiv(length, 16), (unsigned)Cuda::ceilDiv(length, 16), 1); flipKernel<<>>(dst.get(), src.get(), (unsigned)length); return CUDA_STATUS; } Status flop(GPU::Buffer dst, GPU::Buffer src, size_t length, GPU::Stream stream) { dim3 dimBlock(16, 16, 1); dim3 dimGrid((unsigned)Cuda::ceilDiv(length, 16), (unsigned)Cuda::ceilDiv(length, 16), 1); flopKernel<<>>(dst.get(), src.get(), (unsigned)length); return CUDA_STATUS; } Status rotate(GPU::Buffer dst, GPU::Buffer src, size_t length, GPU::Stream stream) { dim3 dimBlock(16, 16, 1); dim3 dimGrid((unsigned)Cuda::ceilDiv(length, 16), (unsigned)Cuda::ceilDiv(length, 16), 1); rotateKernel<<>>(dst.get(), src.get(), (unsigned)length); return CUDA_STATUS; } Status rotateLeft(GPU::Buffer dst, GPU::Buffer src, size_t length, GPU::Stream stream) { dim3 dimBlock(16, 16, 1); dim3 dimGrid((unsigned)Cuda::ceilDiv(length, 16), (unsigned)Cuda::ceilDiv(length, 16), 1); rotateLeftKernel<<>>(dst.get(), src.get(), (unsigned)length); return CUDA_STATUS; } Status rotateRight(GPU::Buffer dst, GPU::Buffer src, size_t length, GPU::Stream stream) { dim3 dimBlock(16, 16, 1); dim3 dimGrid((unsigned)Cuda::ceilDiv(length, 16), (unsigned)Cuda::ceilDiv(length, 16), 1); rotateRightKernel<<>>(dst.get(), src.get(), (unsigned)length); return CUDA_STATUS; } } // namespace Image } // namespace VideoStitch