yum-mirror/VkFFT

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

Dmitrii TolmachevVkFFT v1.3.4 release -Stable release that incorporates all the v1.3.3 bugfixes - no new functionality in this release -Tests reference: https://github.com/vincefn/pyvkfft/issues/32#issuecomment-1904238557066a17c

master
3.1 KiB112 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#ifdef VKFFT_USE_DOUBLEDOUBLE_FP128
75
76#define VKFFT_USE_QUADMATH_FP128 // for now the only implementation, but defining these functions as mpfr should also be possible
77#include <quadmath.h>
78//#define pfQ __float128
79#define pfLD __float128
80#define pfUINT uint64_t
81#define pfINT int64_t
82#define pfsin sinq
83#define pfcos cosq
84#define pfceil ceilq
85#define pffloor floorq
86#define pfsqrt sqrtq
87
88#define pfFPinit(x) strtoflt128(x, 0)
89
90#else
91#define pfLD long double
92#define pfUINT uint64_t
93#define pfINT int64_t
94#define pfsin sin
95#define pfcos cos
96#define pfceil ceil
97#define pffloor floor
98#define pfsqrt sqrt
99
100#define pfFPinit(x) strtold(x, 0)
101
102#endif
103
104#include "vkFFT/vkFFT_Structs/vkFFT_Structs.h"
105#include "vkFFT/vkFFT_AppManagement/vkFFT_RunApp.h"
106#include "vkFFT/vkFFT_AppManagement/vkFFT_InitializeApp.h"
107#include "vkFFT/vkFFT_AppManagement/vkFFT_DeleteApp.h"
108
109static inline int VkFFTGetVersion() {
110	return 10304; //X.XX.XX format
111}
112#endif