yum-mirror/VkFFT

git clone https://git.yummers.dev/yum-mirror/VkFFT

Dmitrii TolmachevVersion 1.3 update of VkFFT -Major library design change - from single header to multiple header approach, which improves structure and maintainability. Now instead of copying a single file, the user has to copy the vkFFT folder contents. -VkFFT has been rewritten to follow the multiple-level platform structure, described in the VkFFT whitepaper. All algorithms have been split into respective files, which should ease an understanding of the library design by everybody. Multiple code duplication places have been restructured and unified (mainly the read/write part of kernels and pre/post-processing). -All math operations and most variables have been abstracted to a union container approach, that can either contain numbers or variable names. Not a full compiler, but the code generated is close to machine-like. There are no math sprintf calls in the actual code generator now. More details can be found here: https://youtu.be/lHlFPqlOezo -VkFFT supports arbitrary number of dimensions now. By defining VKFFT_MAX_FFT_DIMENSIONS, it is now possible to mimic fftw guru interface. Default 4. Innermost stride is always fixed to be 1, but there can be an arbitrary number of outer strides. to achieve innermost batching, initialize N+1 dim FFT and omit the innermost one using omitDimension[0] = 1. -Enabled fp16 for all backends. -Accuracy verification of the new version can be found here: vincefn/pyvkfft#25 -The new code structure will facilitate the implementation of many new features and performance improvements, so stay tuned.116bf7f

v1.3.1
2.5 KiB82 linesraw
1// This file is part of VkFFT, a Vulkan Fast Fourier Transform library
2//
3// Copyright (C) 2020 - present Dmitrii Tolmachev <dtolm96@gmail.com>
4//
5// Permission is hereby granted, free of charge, to any person obtaining a copy
6// of this software and associated documentation files (the "Software"), to deal
7// in the Software without restriction, including without limitation the rights
8// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9// copies of the Software, and to permit persons to whom the Software is
10// furnished to do so, subject to the following conditions:
11//
12// The above copyright notice and this permission notice shall be included in
13// all copies or substantial portions of the Software.
14//
15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21// THE SOFTWARE.
22
23#ifndef VKFFT_H
24#define VKFFT_H
25
26#include <locale.h>
27#include <memory.h>
28#include <math.h>
29#include <stdio.h>
30#include <stdlib.h>
31#include <string.h>
32#ifndef __STDC_FORMAT_MACROS
33#define __STDC_FORMAT_MACROS
34#endif
35#include <inttypes.h>
36#if(VKFFT_BACKEND==0)
37#include "vulkan/vulkan.h"
38#include "glslang_c_interface.h"
39#elif(VKFFT_BACKEND==1)
40#include <nvrtc.h>
41#include <cuda.h>
42#include <cuda_runtime.h>
43#include <cuda_runtime_api.h>
44#include <cuComplex.h>
45#ifndef CUDA_TOOLKIT_ROOT_DIR
46#define CUDA_TOOLKIT_ROOT_DIR ""
47#endif
48#elif(VKFFT_BACKEND==2)
49#include <hip/hiprtc.h>
50#include <hip/hip_runtime.h>
51#include <hip/hip_runtime_api.h>
52#include <hip/hip_complex.h>
53#elif(VKFFT_BACKEND==3)
54#ifndef CL_USE_DEPRECATED_OPENCL_1_2_APIS
55#define CL_USE_DEPRECATED_OPENCL_1_2_APIS
56#endif
57#ifdef __APPLE__
58#include <OpenCL/opencl.h>
59#else
60#include <CL/cl.h>
61#endif
62#endif
63
64#ifdef __cplusplus
65#define VKFFT_ZERO_INIT {}
66#else
67#define VKFFT_ZERO_INIT {0}
68#endif
69
70#ifndef VKFFT_MAX_FFT_DIMENSIONS
71#define VKFFT_MAX_FFT_DIMENSIONS 4
72#endif
73
74#include "vkFFT/vkFFT_Structs/vkFFT_Structs.h"
75#include "vkFFT/vkFFT_AppManagement/vkFFT_RunApp.h"
76#include "vkFFT/vkFFT_AppManagement/vkFFT_InitializeApp.h"
77#include "vkFFT/vkFFT_AppManagement/vkFFT_DeleteApp.h"
78
79static inline int VkFFTGetVersion() {
80	return 10301; //X.XX.XX format
81}
82#endif