Path: blob/master/src/utils/style_ops/upfirdn2d.h
809 views
// Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved.1//2// NVIDIA CORPORATION and its licensors retain all intellectual property3// and proprietary rights in and to this software, related documentation4// and any modifications thereto. Any use, reproduction, disclosure or5// distribution of this software and related documentation without an express6// license agreement from NVIDIA CORPORATION is strictly prohibited.78#include <cuda_runtime.h>910//------------------------------------------------------------------------11// CUDA kernel parameters.1213struct upfirdn2d_kernel_params14{15const void* x;16const float* f;17void* y;1819int2 up;20int2 down;21int2 pad0;22int flip;23float gain;2425int4 inSize; // [width, height, channel, batch]26int4 inStride;27int2 filterSize; // [width, height]28int2 filterStride;29int4 outSize; // [width, height, channel, batch]30int4 outStride;31int sizeMinor;32int sizeMajor;3334int loopMinor;35int loopMajor;36int loopX;37int launchMinor;38int launchMajor;39};4041//------------------------------------------------------------------------42// CUDA kernel specialization.4344struct upfirdn2d_kernel_spec45{46void* kernel;47int tileOutW;48int tileOutH;49int loopMinor;50int loopX;51};5253//------------------------------------------------------------------------54// CUDA kernel selection.5556template <class T> upfirdn2d_kernel_spec choose_upfirdn2d_kernel(const upfirdn2d_kernel_params& p);5758//------------------------------------------------------------------------596061