CoolFace
Apppublic

riciii7/FastAPI-Batik-GAN

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
upfirdn2d.h60 linesDownload Raw Back to ops
1// Copyright (c) 2021, NVIDIA CORPORATION.  All rights reserved.2//3// NVIDIA CORPORATION and its licensors retain all intellectual property4// and proprietary rights in and to this software, related documentation5// and any modifications thereto.  Any use, reproduction, disclosure or6// distribution of this software and related documentation without an express7// license agreement from NVIDIA CORPORATION is strictly prohibited.8 9#include <cuda_runtime.h>10 11//------------------------------------------------------------------------12// CUDA kernel parameters.13 14struct upfirdn2d_kernel_params15{16    const void*     x;17    const float*    f;18    void*           y;19 20    int2            up;21    int2            down;22    int2            pad0;23    int             flip;24    float           gain;25 26    int4            inSize;         // [width, height, channel, batch]27    int4            inStride;28    int2            filterSize;     // [width, height]29    int2            filterStride;30    int4            outSize;        // [width, height, channel, batch]31    int4            outStride;32    int             sizeMinor;33    int             sizeMajor;34 35    int             loopMinor;36    int             loopMajor;37    int             loopX;38    int             launchMinor;39    int             launchMajor;40};41 42//------------------------------------------------------------------------43// CUDA kernel specialization.44 45struct upfirdn2d_kernel_spec46{47    void*   kernel;48    int     tileOutW;49    int     tileOutH;50    int     loopMinor;51    int     loopX;52};53 54//------------------------------------------------------------------------55// CUDA kernel selection.56 57template <class T> upfirdn2d_kernel_spec choose_upfirdn2d_kernel(const upfirdn2d_kernel_params& p);58 59//------------------------------------------------------------------------60