yum-mirror/VkFFT

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

Tolmachev DmitriiMerge pull request #125 from DTolm/developa7a5397

v1.3.1
36.9 KiB1007 linesraw
1#include <vector>
2#include <memory>
3#include <string.h>
4#include <chrono>
5#include <thread>
6#include <iostream>
7#include <algorithm>
8#define __STDC_FORMAT_MACROS
9#include <inttypes.h>
10#if(VKFFT_BACKEND==0)
11#include "vulkan/vulkan.h"
12#include "glslang_c_interface.h"
13#elif(VKFFT_BACKEND==1)
14#include <cuda.h>
15#include <cuda_runtime.h>
16#include <nvrtc.h>
17#include <cuda_runtime_api.h>
18#include <cuComplex.h>
19#elif(VKFFT_BACKEND==2)
20#ifndef __HIP_PLATFORM_HCC__
21#define __HIP_PLATFORM_HCC__
22#endif
23#include <hip/hip_runtime.h>
24#include <hip/hiprtc.h>
25#include <hip/hip_runtime_api.h>
26#include <hip/hip_complex.h>
27#elif(VKFFT_BACKEND==3)
28#ifndef CL_USE_DEPRECATED_OPENCL_1_2_APIS
29#define CL_USE_DEPRECATED_OPENCL_1_2_APIS
30#endif
31#ifdef __APPLE__
32#include <OpenCL/opencl.h>
33#else
34#include <CL/cl.h>
35#endif 
36#elif(VKFFT_BACKEND==4)
37#include <ze_api.h>
38#elif(VKFFT_BACKEND==5)
39#ifndef NS_PRIVATE_IMPLEMENTATION
40#define NS_PRIVATE_IMPLEMENTATION
41#endif
42#ifndef CA_PRIVATE_IMPLEMENTATION
43#define CA_PRIVATE_IMPLEMENTATION
44#endif
45#ifndef MTL_PRIVATE_IMPLEMENTATION
46#define MTL_PRIVATE_IMPLEMENTATION
47#endif
48#include "Foundation/Foundation.hpp"
49#include "QuartzCore/QuartzCore.hpp"
50#include "Metal/Metal.hpp"
51#endif
52#include "vkFFT.h"
53#include "utils_VkFFT.h"
54#include "half.hpp"
55#include "user_benchmark_VkFFT.h"
56#include "sample_0_benchmark_VkFFT_single.h"
57#include "sample_1_benchmark_VkFFT_double.h"
58#include "sample_2_benchmark_VkFFT_half.h"
59#include "sample_3_benchmark_VkFFT_single_3d.h"
60#include "sample_4_benchmark_VkFFT_single_3d_zeropadding.h"
61#include "sample_5_benchmark_VkFFT_single_disableReorderFourStep.h"
62#include "sample_6_benchmark_VkFFT_single_r2c.h"
63#include "sample_7_benchmark_VkFFT_single_Bluestein.h"
64#include "sample_8_benchmark_VkFFT_double_Bluestein.h"
65#include "sample_10_benchmark_VkFFT_single_multipleBuffers.h"
66#ifdef USE_FFTW
67#include "sample_11_precision_VkFFT_single.h"
68#include "sample_12_precision_VkFFT_double.h"
69#include "sample_13_precision_VkFFT_half.h"
70#include "sample_14_precision_VkFFT_single_nonPow2.h"
71#include "sample_15_precision_VkFFT_single_r2c.h"
72#include "sample_16_precision_VkFFT_single_dct.h"
73#include "sample_17_precision_VkFFT_double_dct.h"
74#include "sample_18_precision_VkFFT_double_nonPow2.h"
75#endif
76#include "sample_50_convolution_VkFFT_single_1d_matrix.h"
77#include "sample_51_convolution_VkFFT_single_3d_matrix_zeropadding_r2c.h"
78#include "sample_52_convolution_VkFFT_single_2d_batched_r2c.h"
79
80#include "sample_100_benchmark_VkFFT_single_nd_dct.h"
81#include "sample_101_benchmark_VkFFT_double_nd_dct.h"
82#include "sample_1000_VkFFT_single_2_4096.h"
83#include "sample_1001_benchmark_VkFFT_double_2_4096.h"
84#include "sample_1003_benchmark_VkFFT_single_3d_2_512.h"
85
86#ifdef USE_cuFFT
87#include "user_benchmark_cuFFT.h"
88#include "sample_0_benchmark_cuFFT_single.h"
89#include "sample_1_benchmark_cuFFT_double.h"
90#include "sample_2_benchmark_cuFFT_half.h"
91#include "sample_3_benchmark_cuFFT_single_3d.h"
92#include "sample_6_benchmark_cuFFT_single_r2c.h"
93#include "sample_7_benchmark_cuFFT_single_Bluestein.h"
94#include "sample_8_benchmark_cuFFT_double_Bluestein.h"
95#include "sample_1000_benchmark_cuFFT_single_2_4096.h"
96#include "sample_1001_benchmark_cuFFT_double_2_4096.h"
97#include "sample_1003_benchmark_cuFFT_single_3d_2_512.h"
98#endif  
99#ifdef USE_rocFFT
100#include "user_benchmark_rocFFT.h"
101#include "sample_0_benchmark_rocFFT_single.h"
102#include "sample_1_benchmark_rocFFT_double.h"
103#include "sample_3_benchmark_rocFFT_single_3d.h"
104#include "sample_6_benchmark_rocFFT_single_r2c.h"
105#include "sample_7_benchmark_rocFFT_single_Bluestein.h"
106#include "sample_8_benchmark_rocFFT_double_Bluestein.h"
107#include "sample_1000_benchmark_rocFFT_single_2_4096.h"
108#include "sample_1001_benchmark_rocFFT_double_2_4096.h"
109#include "sample_1003_benchmark_rocFFT_single_3d_2_512.h"
110#endif 
111#ifdef USE_FFTW
112#include "fftw3.h"
113#endif
114
115VkFFTResult launchVkFFT(VkGPU* vkGPU, uint64_t sample_id, bool file_output, FILE* output, VkFFTUserSystemParameters* userParams) {
116	//Sample Vulkan project GPU initialization.
117	VkFFTResult resFFT = VKFFT_SUCCESS;
118
119#if(VKFFT_BACKEND==0)
120	VkResult res = VK_SUCCESS;
121	//create instance - a connection between the application and the Vulkan library 
122	res = createInstance(vkGPU, sample_id);
123	if (res != 0) {
124		//printf("Instance creation failed, error code: %" PRIu64 "\n", res);
125		return VKFFT_ERROR_FAILED_TO_CREATE_INSTANCE;
126	}
127	//set up the debugging messenger 
128	res = setupDebugMessenger(vkGPU);
129	if (res != 0) {
130		//printf("Debug messenger creation failed, error code: %" PRIu64 "\n", res);
131		return VKFFT_ERROR_FAILED_TO_SETUP_DEBUG_MESSENGER;
132	}
133	//check if there are GPUs that support Vulkan and select one
134	res = findPhysicalDevice(vkGPU);
135	if (res != 0) {
136		//printf("Physical device not found, error code: %" PRIu64 "\n", res);
137		return VKFFT_ERROR_FAILED_TO_FIND_PHYSICAL_DEVICE;
138	}
139	//create logical device representation
140	res = createDevice(vkGPU, sample_id);
141	if (res != 0) {
142		//printf("Device creation failed, error code: %" PRIu64 "\n", res);
143		return VKFFT_ERROR_FAILED_TO_CREATE_DEVICE;
144	}
145	//create fence for synchronization 
146	res = createFence(vkGPU);
147	if (res != 0) {
148		//printf("Fence creation failed, error code: %" PRIu64 "\n", res);
149		return VKFFT_ERROR_FAILED_TO_CREATE_FENCE;
150	}
151	//create a place, command buffer memory is allocated from
152	res = createCommandPool(vkGPU);
153	if (res != 0) {
154		//printf("Fence creation failed, error code: %" PRIu64 "\n", res);
155		return VKFFT_ERROR_FAILED_TO_CREATE_COMMAND_POOL;
156	}
157	vkGetPhysicalDeviceProperties(vkGPU->physicalDevice, &vkGPU->physicalDeviceProperties);
158	vkGetPhysicalDeviceMemoryProperties(vkGPU->physicalDevice, &vkGPU->physicalDeviceMemoryProperties);
159
160	glslang_initialize_process();//compiler can be initialized before VkFFT
161#elif(VKFFT_BACKEND==1)
162	CUresult res = CUDA_SUCCESS;
163	cudaError_t res2 = cudaSuccess;
164	res = cuInit(0);
165	if (res != CUDA_SUCCESS) return VKFFT_ERROR_FAILED_TO_INITIALIZE;
166	res2 = cudaSetDevice((int)vkGPU->device_id);
167	if (res2 != cudaSuccess) return VKFFT_ERROR_FAILED_TO_SET_DEVICE_ID;
168	res = cuDeviceGet(&vkGPU->device, (int)vkGPU->device_id);
169	if (res != CUDA_SUCCESS) return VKFFT_ERROR_FAILED_TO_GET_DEVICE;
170	res = cuCtxCreate(&vkGPU->context, 0, (int)vkGPU->device);
171	if (res != CUDA_SUCCESS) return VKFFT_ERROR_FAILED_TO_CREATE_CONTEXT;
172#elif(VKFFT_BACKEND==2)
173	hipError_t res = hipSuccess;
174	res = hipInit(0);
175	if (res != hipSuccess) return VKFFT_ERROR_FAILED_TO_INITIALIZE;
176	res = hipSetDevice((int)vkGPU->device_id);
177	if (res != hipSuccess) return VKFFT_ERROR_FAILED_TO_SET_DEVICE_ID;
178	res = hipDeviceGet(&vkGPU->device, (int)vkGPU->device_id);
179	if (res != hipSuccess) return VKFFT_ERROR_FAILED_TO_GET_DEVICE;
180	res = hipCtxCreate(&vkGPU->context, 0, (int)vkGPU->device);
181	if (res != hipSuccess) return VKFFT_ERROR_FAILED_TO_CREATE_CONTEXT;
182#elif(VKFFT_BACKEND==3)
183	cl_int res = CL_SUCCESS;
184	cl_uint numPlatforms;
185	res = clGetPlatformIDs(0, 0, &numPlatforms);
186	if (res != CL_SUCCESS) return VKFFT_ERROR_FAILED_TO_INITIALIZE;
187	cl_platform_id* platforms = (cl_platform_id*)malloc(sizeof(cl_platform_id) * numPlatforms);
188	if (!platforms) return VKFFT_ERROR_MALLOC_FAILED;
189	res = clGetPlatformIDs(numPlatforms, platforms, 0);
190	if (res != CL_SUCCESS) return VKFFT_ERROR_FAILED_TO_INITIALIZE;
191	uint64_t k = 0;
192	for (uint64_t j = 0; j < numPlatforms; j++) {
193		cl_uint numDevices;
194		res = clGetDeviceIDs(platforms[j], CL_DEVICE_TYPE_ALL, 0, 0, &numDevices);
195		cl_device_id* deviceList = (cl_device_id*)malloc(sizeof(cl_device_id) * numDevices);
196		if (!deviceList) return VKFFT_ERROR_MALLOC_FAILED;
197		res = clGetDeviceIDs(platforms[j], CL_DEVICE_TYPE_ALL, numDevices, deviceList, 0);
198		if (res != CL_SUCCESS) return VKFFT_ERROR_FAILED_TO_GET_DEVICE;
199		for (uint64_t i = 0; i < numDevices; i++) {
200			if (k == vkGPU->device_id) {
201				vkGPU->platform = platforms[j];
202				vkGPU->device = deviceList[i];
203				vkGPU->context = clCreateContext(NULL, 1, &vkGPU->device, NULL, NULL, &res);
204				if (res != CL_SUCCESS) return VKFFT_ERROR_FAILED_TO_CREATE_CONTEXT;
205				cl_command_queue commandQueue = clCreateCommandQueue(vkGPU->context, vkGPU->device, 0, &res);
206				if (res != CL_SUCCESS) return VKFFT_ERROR_FAILED_TO_CREATE_COMMAND_QUEUE;
207				vkGPU->commandQueue = commandQueue;
208				i=numDevices;
209				j=numPlatforms;
210			}
211			else {
212				k++;
213			}
214		}
215		free(deviceList);
216	}
217	free(platforms);
218#elif(VKFFT_BACKEND==4)
219	ze_result_t res = ZE_RESULT_SUCCESS;
220	res = zeInit(0);
221	if (res != ZE_RESULT_SUCCESS) return VKFFT_ERROR_FAILED_TO_INITIALIZE;
222	uint32_t numDrivers = 0;
223	res = zeDriverGet(&numDrivers, 0);
224	if (res != ZE_RESULT_SUCCESS) return VKFFT_ERROR_FAILED_TO_INITIALIZE;
225	ze_driver_handle_t* drivers = (ze_driver_handle_t*)malloc(numDrivers * sizeof(ze_driver_handle_t));
226	if (!drivers) return VKFFT_ERROR_MALLOC_FAILED;
227	res = zeDriverGet(&numDrivers, drivers);
228	if (res != ZE_RESULT_SUCCESS) return VKFFT_ERROR_FAILED_TO_INITIALIZE;
229	uint64_t k = 0;
230	for (uint64_t j = 0; j < numDrivers; j++) {
231		uint32_t numDevices = 0;
232		res = zeDeviceGet(drivers[j], &numDevices, nullptr);
233		if (res != ZE_RESULT_SUCCESS) return VKFFT_ERROR_FAILED_TO_GET_DEVICE;
234		ze_device_handle_t* deviceList = (ze_device_handle_t*)malloc(numDevices * sizeof(ze_device_handle_t));
235		if (!deviceList) return VKFFT_ERROR_MALLOC_FAILED;
236		res = zeDeviceGet(drivers[j], &numDevices, deviceList);
237		if (res != ZE_RESULT_SUCCESS) return VKFFT_ERROR_FAILED_TO_GET_DEVICE;
238		for (uint64_t i = 0; i < numDevices; i++) {
239			if (k == vkGPU->device_id) {
240				vkGPU->driver = drivers[j];
241				vkGPU->device = deviceList[i];
242				ze_context_desc_t contextDescription = {};
243				contextDescription.stype = ZE_STRUCTURE_TYPE_CONTEXT_DESC;
244				res = zeContextCreate(vkGPU->driver, &contextDescription, &vkGPU->context);
245				if (res != ZE_RESULT_SUCCESS) return VKFFT_ERROR_FAILED_TO_CREATE_CONTEXT;
246
247				uint32_t queueGroupCount = 0;
248				res = zeDeviceGetCommandQueueGroupProperties(vkGPU->device, &queueGroupCount, 0);
249				if (res != ZE_RESULT_SUCCESS) return VKFFT_ERROR_FAILED_TO_CREATE_COMMAND_QUEUE;
250
251				ze_command_queue_group_properties_t* cmdqueueGroupProperties = (ze_command_queue_group_properties_t*)malloc(queueGroupCount * sizeof(ze_command_queue_group_properties_t));
252				if (!cmdqueueGroupProperties) return VKFFT_ERROR_MALLOC_FAILED;
253				res = zeDeviceGetCommandQueueGroupProperties(vkGPU->device, &queueGroupCount, cmdqueueGroupProperties);
254				if (res != ZE_RESULT_SUCCESS) return VKFFT_ERROR_FAILED_TO_CREATE_COMMAND_QUEUE;
255
256				uint32_t commandQueueID = -1;
257				for (uint32_t i = 0; i < queueGroupCount; ++i) {
258					if ((cmdqueueGroupProperties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COMPUTE) && (cmdqueueGroupProperties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COPY)) {
259						commandQueueID = i;
260						break;
261					}
262				}
263				if (commandQueueID == -1) return VKFFT_ERROR_FAILED_TO_CREATE_COMMAND_QUEUE;
264				vkGPU->commandQueueID = commandQueueID;
265				ze_command_queue_desc_t commandQueueDescription = {};
266				commandQueueDescription.stype = ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC;
267				commandQueueDescription.ordinal = commandQueueID;
268				commandQueueDescription.priority = ZE_COMMAND_QUEUE_PRIORITY_NORMAL;
269				commandQueueDescription.mode = ZE_COMMAND_QUEUE_MODE_DEFAULT;
270				res = zeCommandQueueCreate(vkGPU->context, vkGPU->device, &commandQueueDescription, &vkGPU->commandQueue);
271				if (res != ZE_RESULT_SUCCESS) return VKFFT_ERROR_FAILED_TO_CREATE_COMMAND_QUEUE;
272				free(cmdqueueGroupProperties);
273				i=numDevices;
274				j=numDrivers;
275			}
276			else {
277				k++;
278			}
279		}
280
281		free(deviceList);
282	}
283	free(drivers);
284#elif(VKFFT_BACKEND==5)
285    NS::Array* devices = MTL::CopyAllDevices();
286    MTL::Device* device = (MTL::Device*)devices->object(vkGPU->device_id);
287    vkGPU->device = device;
288    MTL::CommandQueue* queue = device->newCommandQueue();
289    vkGPU->queue = queue;
290#endif
291
292	uint64_t isCompilerInitialized = 1;
293
294    switch (sample_id) {
295    case 0:
296    {
297        resFFT = sample_0_benchmark_VkFFT_single(vkGPU, file_output, output, isCompilerInitialized);
298        break;
299    }
300    case 1:
301    {
302        resFFT = sample_1_benchmark_VkFFT_double(vkGPU, file_output, output, isCompilerInitialized);
303        break;
304    }
305	case 2:
306    {
307        resFFT = sample_2_benchmark_VkFFT_half(vkGPU, file_output, output, isCompilerInitialized);
308        break;
309    }
310    case 3:
311    {
312        resFFT = sample_3_benchmark_VkFFT_single_3d(vkGPU, file_output, output, isCompilerInitialized);
313        break;
314    }
315    case 4:
316    {
317        resFFT = sample_4_benchmark_VkFFT_single_3d_zeropadding(vkGPU, file_output, output, isCompilerInitialized);
318        break;
319    }
320    case 5:
321    {
322        resFFT = sample_5_benchmark_VkFFT_single_disableReorderFourStep(vkGPU, file_output, output, isCompilerInitialized);
323        break;
324    }
325    case 6:
326    {
327        resFFT = sample_6_benchmark_VkFFT_single_r2c(vkGPU, file_output, output, isCompilerInitialized);
328        break;
329    }
330    case 7:
331    {
332        resFFT = sample_7_benchmark_VkFFT_single_Bluestein(vkGPU, file_output, output, isCompilerInitialized);
333        break;
334    }
335    case 8:
336    {
337        resFFT = sample_8_benchmark_VkFFT_double_Bluestein(vkGPU, file_output, output, isCompilerInitialized);
338        break;
339    }
340#if(VKFFT_BACKEND==0)
341    case 10:
342    {
343        resFFT = sample_10_benchmark_VkFFT_single_multipleBuffers(vkGPU, file_output, output, isCompilerInitialized);
344        break;
345    }
346#endif
347#ifdef USE_FFTW
348    case 11:
349    {
350        resFFT = sample_11_precision_VkFFT_single(vkGPU, file_output, output, isCompilerInitialized);
351        break;
352    }
353    case 12:
354    {
355        resFFT = sample_12_precision_VkFFT_double(vkGPU, file_output, output, isCompilerInitialized);
356        break;
357    }
358	case 13:
359    {
360        resFFT = sample_13_precision_VkFFT_half(vkGPU, file_output, output, isCompilerInitialized);
361        break;
362    }
363    case 14:
364    {
365        resFFT = sample_14_precision_VkFFT_single_nonPow2(vkGPU, file_output, output, isCompilerInitialized);
366        break;
367    }
368    case 15:
369    {
370        resFFT = sample_15_precision_VkFFT_single_r2c(vkGPU, file_output, output, isCompilerInitialized);
371        break;
372    }
373    case 16:
374    {
375        resFFT = sample_16_precision_VkFFT_single_dct(vkGPU, file_output, output, isCompilerInitialized);
376        break;
377    }
378    case 17:
379    {
380        resFFT = sample_17_precision_VkFFT_double_dct(vkGPU, file_output, output, isCompilerInitialized);
381        break;
382    }
383    case 18:
384    {
385        resFFT = sample_18_precision_VkFFT_double_nonPow2(vkGPU, file_output, output, isCompilerInitialized);
386        break;
387    }
388#endif
389    case 50:
390    {
391        resFFT = sample_50_convolution_VkFFT_single_1d_matrix(vkGPU, file_output, output, isCompilerInitialized);
392        break;
393    }
394    case 51:
395    {
396        resFFT = sample_51_convolution_VkFFT_single_3d_matrix_zeropadding_r2c(vkGPU, file_output, output, isCompilerInitialized);
397        break;
398    }
399    case 52:
400    {
401        resFFT = sample_52_convolution_VkFFT_single_2d_batched_r2c(vkGPU, file_output, output, isCompilerInitialized);
402        break;
403    }
404    case 110:
405    {
406        resFFT = sample_100_benchmark_VkFFT_single_nd_dct(vkGPU, file_output, output, isCompilerInitialized, 1);
407        break;
408    }
409    case 120:
410    {
411        resFFT = sample_100_benchmark_VkFFT_single_nd_dct(vkGPU, file_output, output, isCompilerInitialized, 2);
412        break;
413    }
414    case 130:
415    {
416        resFFT = sample_100_benchmark_VkFFT_single_nd_dct(vkGPU, file_output, output, isCompilerInitialized, 3);
417        break;
418    }
419    case 140:
420    {
421        resFFT = sample_100_benchmark_VkFFT_single_nd_dct(vkGPU, file_output, output, isCompilerInitialized, 4);
422        break;
423    }
424    case 111:
425    {
426        resFFT = sample_101_benchmark_VkFFT_double_nd_dct(vkGPU, file_output, output, isCompilerInitialized, 1);
427        break;
428    }
429    case 121:
430    {
431        resFFT = sample_101_benchmark_VkFFT_double_nd_dct(vkGPU, file_output, output, isCompilerInitialized, 2);
432        break;
433    }
434    case 131:
435    {
436        resFFT = sample_101_benchmark_VkFFT_double_nd_dct(vkGPU, file_output, output, isCompilerInitialized, 3);
437        break;
438    }
439    case 141:
440    {
441        resFFT = sample_101_benchmark_VkFFT_double_nd_dct(vkGPU, file_output, output, isCompilerInitialized, 4);
442        break;
443    }
444    case 200: case 201:
445    {
446        resFFT = user_benchmark_VkFFT(vkGPU, file_output, output, isCompilerInitialized, userParams);
447        break;
448    }
449	case 202:
450    {
451        resFFT = user_benchmark_VkFFT(vkGPU, file_output, output, isCompilerInitialized, userParams);
452        break;
453    }
454    case 1000:
455    {
456        resFFT = sample_1000_VkFFT_single_2_4096(vkGPU, file_output, output, isCompilerInitialized);
457        break;
458    }
459    case 1001:
460    {
461        resFFT = sample_1001_benchmark_VkFFT_double_2_4096(vkGPU, file_output, output, isCompilerInitialized);
462        break;
463    }
464    case 1003:
465    {
466        resFFT = sample_1003_benchmark_VkFFT_single_3d_2_512(vkGPU, file_output, output, isCompilerInitialized);
467        break;
468    }
469    }
470#if(VKFFT_BACKEND==0)
471	vkDestroyFence(vkGPU->device, vkGPU->fence, NULL);
472	vkDestroyCommandPool(vkGPU->device, vkGPU->commandPool, NULL);
473	vkDestroyDevice(vkGPU->device, NULL);
474	DestroyDebugUtilsMessengerEXT(vkGPU, NULL);
475	vkDestroyInstance(vkGPU->instance, NULL);
476	glslang_finalize_process();//destroy compiler after use
477#elif(VKFFT_BACKEND==1)
478	res = cuCtxDestroy(vkGPU->context);
479#elif(VKFFT_BACKEND==2)
480	res = hipCtxDestroy(vkGPU->context);
481#elif(VKFFT_BACKEND==3)
482	res = clReleaseCommandQueue(vkGPU->commandQueue);
483	if (res != CL_SUCCESS) return VKFFT_ERROR_FAILED_TO_RELEASE_COMMAND_QUEUE;
484	clReleaseContext(vkGPU->context);
485#elif(VKFFT_BACKEND==4)
486	res = zeCommandQueueDestroy(vkGPU->commandQueue);
487	if (res != ZE_RESULT_SUCCESS) return VKFFT_ERROR_FAILED_TO_RELEASE_COMMAND_QUEUE;
488	res = zeContextDestroy(vkGPU->context);
489#elif(VKFFT_BACKEND==5)
490    vkGPU->queue->release();
491    vkGPU->device->release();
492    devices->release();
493#endif
494
495	return resFFT;
496}
497
498bool findFlag(char** start, char** end, const std::string& flag) {
499	return (std::find(start, end, flag) != end);
500}
501char* getFlagValue(char** start, char** end, const std::string& flag)
502{
503	char** value = std::find(start, end, flag);
504	value++;
505	if (value != end)
506	{
507		return *value;
508	}
509	return 0;
510}
511int main(int argc, char* argv[])
512{
513	VkGPU vkGPU = {};
514#if(VKFFT_BACKEND==0)
515	vkGPU.enableValidationLayers = 0;
516#endif
517	bool file_output = false;
518	FILE* output = NULL;
519	int sscanf_res = 0;
520	if (findFlag(argv, argv + argc, "-h"))
521	{
522		//print help
523		int version = VkFFTGetVersion();
524		int version_decomposed[3];
525		version_decomposed[0] = version / 10000;
526		version_decomposed[1] = (version - version_decomposed[0] * 10000) / 100;
527		version_decomposed[2] = (version - version_decomposed[0] * 10000 - version_decomposed[1] * 100);
528		printf("VkFFT v%d.%d.%d (01-08-2023). Author: Tolmachev Dmitrii\n", version_decomposed[0], version_decomposed[1], version_decomposed[2]);
529#if (VKFFT_BACKEND==0)
530		printf("Vulkan backend\n");
531#elif (VKFFT_BACKEND==1)
532		printf("CUDA backend\n");
533#elif (VKFFT_BACKEND==2)
534		printf("HIP backend\n");
535#elif (VKFFT_BACKEND==3)
536		printf("OpenCL backend\n");
537#elif (VKFFT_BACKEND==4)
538		printf("Level Zero backend\n");
539#elif (VKFFT_BACKEND==5)
540        printf("Metal backend\n");
541#endif
542		printf("	-h: print help\n");
543		printf("	-devices: print the list of available device ids, used as -d argument\n");
544		printf("	-d X: select device (default 0)\n");
545		printf("	-o NAME: specify output file path\n");
546		printf("	-vkfft X: launch VkFFT sample X:\n");
547		printf("		0 - FFT + iFFT C2C benchmark 1D batched in single precision\n");
548		printf("		1 - FFT + iFFT C2C benchmark 1D batched in double precision LUT\n");
549		printf("		2 - FFT + iFFT C2C benchmark 1D batched in half precision\n");	
550		printf("		3 - FFT + iFFT C2C multidimensional benchmark in single precision\n");
551		printf("		4 - FFT + iFFT C2C multidimensional benchmark in single precision, native zeropadding\n");
552		printf("		5 - FFT + iFFT C2C benchmark 1D batched in single precision, no reshuffling\n");
553		printf("		6 - FFT + iFFT R2C / C2R benchmark\n");
554		printf("		7 - FFT + iFFT C2C Bluestein benchmark in single precision\n");
555		printf("		8 - FFT + iFFT C2C Bluestein benchmark in double precision\n");
556#if (VKFFT_BACKEND==0)
557		printf("		10 - multiple buffer(4 by default) split version of benchmark 0\n");
558#endif
559#ifdef USE_FFTW
560#ifdef USE_cuFFT
561		printf("		11 - VkFFT / cuFFT / FFTW C2C precision test in single precision\n");
562		printf("		12 - VkFFT / cuFFT / FFTW C2C precision test in double precision\n");
563		printf("		13 - VkFFT / cuFFT / FFTW C2C precision test in half precision\n");
564		printf("		14 - VkFFT / FFTW C2C radix 3 / 5 / 7 / 11 / 13 / Bluestein precision test in single precision\n");
565		printf("		15 - VkFFT / cuFFT / FFTW R2C+C2R precision test in single precision\n");
566		printf("		16 - VkFFT / FFTW R2R DCT-I, II, III and IV precision test in single precision\n");
567		printf("		17 - VkFFT / FFTW R2R DCT-I, II, III and IV precision test in double precision\n");
568		printf("		18 - VkFFT / FFTW C2C radix 3 / 5 / 7 / 11 / 13 / Bluestein precision test in double precision\n");
569#elif USE_rocFFT
570		printf("		11 - VkFFT / rocFFT / FFTW C2C precision test in single precision\n");
571		printf("		12 - VkFFT / rocFFT / FFTW C2C precision test in double precision\n");
572		printf("		13 - VkFFT / FFTW C2C precision test in half precision\n");
573		printf("		14 - VkFFT / FFTW C2C radix 3 / 5 / 7 / 11 / 13 / Bluestein precision test in single precision\n");
574		printf("		15 - VkFFT / rocFFT / FFTW R2C+C2R precision test in single precision\n");
575		printf("		16 - VkFFT / FFTW R2R DCT-I, II, III and IV precision test in single precision\n");
576		printf("		17 - VkFFT / FFTW R2R DCT-I, II, III and IV precision test in double precision\n");
577		printf("		18 - VkFFT / FFTW C2C radix 3 / 5 / 7 / 11 / 13 / Bluestein precision test in double precision\n");
578#else
579		printf("		11 - VkFFT / FFTW C2C precision test in single precision\n");
580		printf("		12 - VkFFT / FFTW C2C precision test in double precision\n");
581		printf("		13 - VkFFT / FFTW C2C precision test in half precision\n");
582		printf("		14 - VkFFT / FFTW C2C radix 3 / 5 / 7 / 11 / 13 / Bluestein precision test in single precision\n");
583		printf("		15 - VkFFT / FFTW R2C+C2R precision test in single precision\n");
584		printf("		16 - VkFFT / FFTW R2R DCT-I, II, III and IV precision test in single precision\n");
585		printf("		17 - VkFFT / FFTW R2R DCT-I, II, III and IV precision test in double precision\n");
586		printf("		18 - VkFFT / FFTW C2C radix 3 / 5 / 7 / 11 / 13 / Bluestein precision test in double precision\n");
587#endif
588#endif
589		printf("		50 - convolution example with identity kernel\n");
590		printf("		51 - zeropadding convolution example with identity kernel\n");
591		printf("		52 - batched convolution example with identity kernel\n");
592		printf("		110 - VkFFT FFT + iFFT R2R DCT-1 multidimensional benchmark in single precision\n");
593		printf("		111 - VkFFT FFT + iFFT R2R DCT-1 multidimensional benchmark in double precision\n");
594		printf("		120 - VkFFT FFT + iFFT R2R DCT-2 multidimensional benchmark in single precision\n");
595		printf("		121 - VkFFT FFT + iFFT R2R DCT-2 multidimensional benchmark in double precision\n");
596		printf("		130 - VkFFT FFT + iFFT R2R DCT-3 multidimensional benchmark in single precision\n");
597		printf("		131 - VkFFT FFT + iFFT R2R DCT-3 multidimensional benchmark in double precision\n");
598		printf("		140 - VkFFT FFT + iFFT R2R DCT-4 multidimensional benchmark in single precision\n");
599		printf("		141 - VkFFT FFT + iFFT R2R DCT-4 multidimensional benchmark in double precision\n");
600
601		printf("		1000 - FFT + iFFT C2C benchmark 1D batched in single precision: all supported systems from 2 to 4096\n");
602		printf("		1001 - FFT + iFFT C2C benchmark 1D batched in double precision: all supported systems from 2 to 4096\n");
603		printf("		1003 - FFT + iFFT C2C multidimensional benchmark in single precision: all supported cubes from 2 to 512\n");
604		printf("	-benchmark_vkfft: run VkFFT benchmark on a user-defined system:\n\
605		-X uint, -Y uint, -Z uint - FFT dimensions (default Y and Z are 1)\n");
606		printf("\
607		-P uint - precision (0 - single, 1 - double, 2 - half) (default 0)\n");
608		printf("\
609		-B uint - number of batched systems (default 1)\n\
610		-N uint - number of consecutive FFT+iFFT iterations (default 1)\n\
611		-R2C uint - use R2C (0 - off, 1 - on) (default 0)\n\
612		-DCT uint - perform DCT (0 - off, else type: 1, 2, 3 or 4) (default 0)\n\
613		-save - save generated binaries\n\
614		-load - load previously generated binaries\n");
615#ifdef USE_cuFFT
616		printf("	-cufft X: launch cuFFT sample X:\n");
617		printf("		0 - FFT + iFFT C2C benchmark 1D batched in single precision\n");
618		printf("		1 - FFT + iFFT C2C benchmark 1D batched in double precision LUT\n");
619		printf("		2 - FFT + iFFT C2C benchmark 1D batched in half precision\n");
620		printf("		3 - FFT + iFFT C2C multidimensional benchmark in single precision\n");
621		printf("		6 - FFT + iFFT R2C / C2R benchmark\n");
622		printf("		7 - FFT + iFFT C2C big prime benchmark in single precision (similar to VkFFT Bluestein)\n");
623		printf("		8 - FFT + iFFT C2C big prime benchmark in double precision (similar to VkFFT Bluestein)\n");
624		printf("		1000 - FFT + iFFT C2C benchmark 1D batched in single precision: all supported systems from 2 to 4096\n");
625		printf("		1001 - FFT + iFFT C2C benchmark 1D batched in double precision: all supported systems from 2 to 4096\n");
626		printf("		1003 - FFT + iFFT C2C multidimensional benchmark in single precision: all supported cubes from 2 to 512\n");
627		printf("	-test: (or no -vkfft and -cufft keys) run vkfft benchmarks 0-6 and cufft benchmarks 0-6\n");
628		printf("	-benchmark_cufft: run cuFFT benchmark on a user-defined system:\n\
629		-X uint, -Y uint, -Z uint - FFT dimensions (default Y and Z are 1)\n\
630		-P uint - precision (0 - single, 1 - double) (default 0)\n\
631		-B uint - number of batched systems (default 1)\n\
632		-N uint - number of consecutive FFT+iFFT iterations (default 1)\n\
633		-R2C uint - use R2C (0 - off, 1 - on) (default 0)\n");
634#elif USE_rocFFT
635		printf("	-rocfft X: launch rocFFT sample X:\n");
636		printf("		0 - FFT + iFFT C2C benchmark 1D batched in single precision\n");
637		printf("		1 - FFT + iFFT C2C benchmark 1D batched in double precision LUT\n");
638		printf("		3 - FFT + iFFT C2C multidimensional benchmark in single precision\n");
639		printf("		6 - FFT + iFFT R2C / C2R benchmark\n");
640		printf("		7 - FFT + iFFT C2C big prime benchmark in single precision (similar to VkFFT Bluestein)\n");
641		printf("		8 - FFT + iFFT C2C big prime benchmark in double precision (similar to VkFFT Bluestein)\n");
642		printf("		1000 - FFT + iFFT C2C benchmark 1D batched in single precision: all supported systems from 2 to 4096\n");
643		printf("		1001 - FFT + iFFT C2C benchmark 1D batched in double precision: all supported systems from 2 to 4096\n");
644		printf("		1003 - FFT + iFFT C2C multidimensional benchmark in single precision: all supported cubes from 2 to 512\n");
645		printf("	-test: (or no -vkfft and -rocfft keys) run vkfft benchmarks 0-6 and rocfft benchmarks 0-6\n");
646		printf("	-benchmark_rocfft: run rocFFT benchmark on a user-defined system:\n\
647		-X uint, -Y uint, -Z uint - FFT dimensions (default Y and Z are 1)\n\
648		-P uint - precision (0 - single, 1 - double) (default 0)\n\
649		-B uint - number of batched systems (default 1)\n\
650		-N uint - number of consecutive FFT+iFFT iterations (default 1)\n\
651		-R2C uint - use R2C (0 - off, 1 - on) (default 0)\n");
652#else
653		printf("	-test: run vkfft benchmarks 0-6\n");
654		printf("	-cufft command is disabled\n");
655		printf("	-rocfft command is disabled\n");
656#endif
657		return 0;
658	}
659	if (findFlag(argv, argv + argc, "-devices"))
660	{
661		//print device list
662		VkFFTResult resFFT = devices_list();
663		return resFFT;
664	}
665	if (findFlag(argv, argv + argc, "-d"))
666	{
667		//select device_id
668		char* value = getFlagValue(argv, argv + argc, "-d");
669		if (value != 0) {
670			sscanf_res = sscanf(value, "%" PRIu64 "", &vkGPU.device_id);
671			if (sscanf_res <= 0) {
672				printf("sscanf failed\n");
673				return 1;
674			}
675		}
676		else {
677			printf("No device is selected with -d flag\n");
678			return 1;
679		}
680	}
681	if (findFlag(argv, argv + argc, "-o"))
682	{
683		//specify output file
684		char* value = getFlagValue(argv, argv + argc, "-o");
685		if (value != 0) {
686			file_output = true;
687			output = fopen(value, "a");
688		}
689		else {
690			printf("No output file is selected with -o flag\n");
691			return 1;
692		}
693	}
694	if (findFlag(argv, argv + argc, "-benchmark_vkfft") || findFlag(argv, argv + argc, "-benchmark_cufft") || findFlag(argv, argv + argc, "-benchmark_rocfft"))
695	{
696		//select sample_id
697		VkFFTUserSystemParameters userParams = {};
698		userParams.X = 1;
699		userParams.Y = 1;
700		userParams.Z = 1;
701		userParams.P = 0;
702		userParams.B = 1;
703		userParams.N = 1;
704		userParams.R2C = 0;
705		userParams.DCT = 0;
706		if (findFlag(argv, argv + argc, "-X"))
707		{
708			char* value = getFlagValue(argv, argv + argc, "-X");
709			if (value != 0) {
710				sscanf_res = sscanf(value, "%" PRIu64 "", &userParams.X);
711				if (sscanf_res <= 0) {
712					printf("sscanf failed\n");
713					return 1;
714				}
715			}
716			else {
717				printf("No dimension is selected with -X flag\n");
718				return 1;
719			}
720		}
721		else {
722			printf("No -X flag is selected\n");
723			return 1;
724		}
725		if (findFlag(argv, argv + argc, "-Y"))
726		{
727			char* value = getFlagValue(argv, argv + argc, "-Y");
728			if (value != 0) {
729				sscanf_res = sscanf(value, "%" PRIu64 "", &userParams.Y);
730				if (sscanf_res <= 0) {
731					printf("sscanf failed\n");
732					return 1;
733				}
734			}
735			else {
736				printf("No dimension is selected with -Y flag\n");
737				return 1;
738			}
739		}
740		if (findFlag(argv, argv + argc, "-Z"))
741		{
742			char* value = getFlagValue(argv, argv + argc, "-Z");
743			if (value != 0) {
744				sscanf_res = sscanf(value, "%" PRIu64 "", &userParams.Z);
745				if (sscanf_res <= 0) {
746					printf("sscanf failed\n");
747					return 1;
748				}
749			}
750			else {
751				printf("No dimension is selected with -Z flag\n");
752				return 1;
753			}
754		}
755		if (findFlag(argv, argv + argc, "-P"))
756		{
757			char* value = getFlagValue(argv, argv + argc, "-P");
758			if (value != 0) {
759				sscanf_res = sscanf(value, "%" PRIu64 "", &userParams.P);
760				if (sscanf_res <= 0) {
761					printf("sscanf failed\n");
762					return 1;
763				}
764			}
765			else {
766				printf("No precision is selected with -P flag\n");
767				return 1;
768			}
769		}
770		if (findFlag(argv, argv + argc, "-B"))
771		{
772			char* value = getFlagValue(argv, argv + argc, "-B");
773			if (value != 0) {
774				sscanf_res = sscanf(value, "%" PRIu64 "", &userParams.B);
775				if (sscanf_res <= 0) {
776					printf("sscanf failed\n");
777					return 1;
778				}
779			}
780			else {
781				printf("No batch is selected with -B flag\n");
782				return 1;
783			}
784		}
785		if (findFlag(argv, argv + argc, "-N"))
786		{
787			char* value = getFlagValue(argv, argv + argc, "-N");
788			if (value != 0) {
789				sscanf_res = sscanf(value, "%" PRIu64 "", &userParams.N);
790				if (sscanf_res <= 0) {
791					printf("sscanf failed\n");
792					return 1;
793				}
794			}
795			else {
796				printf("No number of iterations is selected with -N flag\n");
797				return 1;
798			}
799		}
800		if (findFlag(argv, argv + argc, "-R2C"))
801		{
802			char* value = getFlagValue(argv, argv + argc, "-R2C");
803			if (value != 0) {
804				sscanf_res = sscanf(value, "%" PRIu64 "", &userParams.R2C);
805				if (sscanf_res <= 0) {
806					printf("sscanf failed\n");
807					return 1;
808				}
809			}
810			else {
811				printf("No R2C parameter is selected with -R2C flag\n");
812				return 1;
813			}
814		}
815		if (findFlag(argv, argv + argc, "-DCT"))
816		{
817			char* value = getFlagValue(argv, argv + argc, "-DCT");
818			if (value != 0) {
819				sscanf_res = sscanf(value, "%" PRIu64 "", &userParams.DCT);
820				if (sscanf_res <= 0) {
821					printf("sscanf failed\n");
822					return 1;
823				}
824			}
825			else {
826				printf("No DCT parameter is selected with -DCT flag\n");
827				return 1;
828			}
829		}
830		if (findFlag(argv, argv + argc, "-save"))
831		{
832			userParams.saveApplicationToString = 1;
833		}
834		if (findFlag(argv, argv + argc, "-load"))
835		{
836			userParams.loadApplicationFromString = 1;
837		}
838		if (findFlag(argv, argv + argc, "-benchmark_vkfft")) {
839			VkFFTResult resFFT = launchVkFFT(&vkGPU, 200 + userParams.P, file_output, output, &userParams);
840			if (resFFT != VKFFT_SUCCESS) return resFFT;
841		}
842		else {
843#ifdef USE_cuFFT
844			if (findFlag(argv, argv + argc, "-benchmark_cufft")) {
845				user_benchmark_cuFFT(file_output, output, (cuFFTUserSystemParameters*)(&userParams), (int)vkGPU.device_id);
846			}
847			return 0;
848#elif USE_rocFFT
849			if (findFlag(argv, argv + argc, "-benchmark_rocfft")) {
850				user_benchmark_rocFFT(file_output, output, (rocFFTUserSystemParameters*)(&userParams), (int)vkGPU.device_id);
851			}
852			return 0;
853#endif
854			return 1;
855		}
856		return 0;
857	}
858
859	if (findFlag(argv, argv + argc, "-vkfft"))
860	{
861		//select sample_id
862		char* value = getFlagValue(argv, argv + argc, "-vkfft");
863		if (value != 0) {
864			uint64_t sample_id = 0;
865			sscanf_res = sscanf(value, "%" PRIu64 "", &sample_id);
866			if (sscanf_res <= 0) {
867				printf("sscanf failed\n");
868				return 1;
869			}
870			VkFFTResult resFFT = launchVkFFT(&vkGPU, sample_id, file_output, output, 0);
871			if (resFFT != VKFFT_SUCCESS) return resFFT;
872		}
873		else {
874			printf("No sample is selected with -vkfft flag\n");
875			return 1;
876		}
877	}
878#ifdef USE_cuFFT
879	if (findFlag(argv, argv + argc, "-cufft"))
880	{
881		//select sample_id
882		char* value = getFlagValue(argv, argv + argc, "-cufft");
883		if (value != 0) {
884			uint64_t sample_id = 0;
885			sscanf_res = sscanf(value, "%" PRIu64 "", &sample_id);
886			if (sscanf_res <= 0) {
887				printf("sscanf failed\n");
888				return 1;
889			}
890			switch (sample_id) {
891			case 0:
892				sample_0_benchmark_cuFFT_single(file_output, output, (int)vkGPU.device_id);
893				break;
894			case 1:
895				sample_1_benchmark_cuFFT_double(file_output, output, (int)vkGPU.device_id);
896				break;
897			case 2:
898				sample_2_benchmark_cuFFT_half(file_output, output, (int)vkGPU.device_id);
899				break;
900			case 3:
901				sample_3_benchmark_cuFFT_single_3d(file_output, output, (int)vkGPU.device_id);
902				break;
903			case 6:
904				sample_6_benchmark_cuFFT_single_r2c(file_output, output, (int)vkGPU.device_id);
905				break;
906			case 7:
907				sample_7_benchmark_cuFFT_single_Bluestein(file_output, output, (int)vkGPU.device_id);
908				break;
909			case 8:
910				sample_8_benchmark_cuFFT_double_Bluestein(file_output, output, (int)vkGPU.device_id);
911				break;
912			case 1000:
913				sample_1000_benchmark_cuFFT_single_2_4096(file_output, output, (int)vkGPU.device_id);
914				break;
915			case 1001:
916				sample_1001_benchmark_cuFFT_double_2_4096(file_output, output, (int)vkGPU.device_id);
917				break;
918			case 1003:
919				sample_1003_benchmark_cuFFT_single_3d_2_512(file_output, output, (int)vkGPU.device_id);
920				break;
921			}
922		}
923		else {
924			printf("No cuFFT script is selected with -cufft flag\n");
925			return 1;
926		}
927	}
928#elif USE_rocFFT
929	if (findFlag(argv, argv + argc, "-rocfft"))
930	{
931		//select sample_id
932		char* value = getFlagValue(argv, argv + argc, "-rocfft");
933		if (value != 0) {
934			uint64_t sample_id = 0;
935			sscanf_res = sscanf(value, "%" PRIu64 "", &sample_id);
936			if (sscanf_res <= 0) {
937				printf("sscanf failed\n");
938				return 1;
939			}
940			switch (sample_id) {
941			case 0:
942				sample_0_benchmark_rocFFT_single(file_output, output, (int)vkGPU.device_id);
943				break;
944			case 1:
945				sample_1_benchmark_rocFFT_double(file_output, output, (int)vkGPU.device_id);
946				break;
947			case 3:
948				sample_3_benchmark_rocFFT_single_3d(file_output, output, (int)vkGPU.device_id);
949				break;
950			case 6:
951				sample_6_benchmark_rocFFT_single_r2c(file_output, output, (int)vkGPU.device_id);
952				break;
953			case 7:
954				sample_7_benchmark_rocFFT_single_Bluestein(file_output, output, (int)vkGPU.device_id);
955				break;
956			case 8:
957				sample_8_benchmark_rocFFT_double_Bluestein(file_output, output, (int)vkGPU.device_id);
958				break;
959			case 1000:
960				sample_1000_benchmark_rocFFT_single_2_4096(file_output, output, (int)vkGPU.device_id);
961				break;
962			case 1001:
963				sample_1001_benchmark_rocFFT_double_2_4096(file_output, output, (int)vkGPU.device_id);
964				break;
965			case 1003:
966				sample_1003_benchmark_rocFFT_single_3d_2_512(file_output, output, (int)vkGPU.device_id);
967				break;
968			}
969		}
970		else {
971			printf("No rocFFT script is selected with -rocfft flag\n");
972			return 1;
973		}
974	}
975#endif
976	if ((findFlag(argv, argv + argc, "-test")) || ((!findFlag(argv, argv + argc, "-cufft")) && (!findFlag(argv, argv + argc, "-rocfft")) && (!findFlag(argv, argv + argc, "-vkfft"))))
977	{
978		if (output == NULL) {
979			file_output = true;
980			output = fopen("result.txt", "a");
981		}
982		for (uint64_t i = 0; i < 9; i++) {
983#if((VKFFT_BACKEND>0) || (VK_API_VERSION == 10))
984			if (i == 2) i++;
985#endif
986			VkFFTResult resFFT = launchVkFFT(&vkGPU, i, file_output, output, 0);
987			if (resFFT != VKFFT_SUCCESS) return resFFT;
988		}
989#ifdef USE_cuFFT
990		sample_0_benchmark_cuFFT_single(file_output, output, (int)vkGPU.device_id);
991		sample_1_benchmark_cuFFT_double(file_output, output, (int)vkGPU.device_id);
992		sample_2_benchmark_cuFFT_half(file_output, output, (int)vkGPU.device_id);
993		sample_3_benchmark_cuFFT_single_3d(file_output, output, (int)vkGPU.device_id);
994		sample_6_benchmark_cuFFT_single_r2c(file_output, output, (int)vkGPU.device_id);
995		sample_7_benchmark_cuFFT_single_Bluestein(file_output, output, (int)vkGPU.device_id);
996		sample_8_benchmark_cuFFT_double_Bluestein(file_output, output, (int)vkGPU.device_id);
997#elif USE_rocFFT
998		sample_0_benchmark_rocFFT_single(file_output, output, (int)vkGPU.device_id);
999		sample_1_benchmark_rocFFT_double(file_output, output, (int)vkGPU.device_id);
1000		sample_3_benchmark_rocFFT_single_3d(file_output, output, (int)vkGPU.device_id);
1001		sample_6_benchmark_rocFFT_single_r2c(file_output, output, (int)vkGPU.device_id);
1002		sample_7_benchmark_rocFFT_single_Bluestein(file_output, output, (int)vkGPU.device_id);
1003		sample_8_benchmark_rocFFT_double_Bluestein(file_output, output, (int)vkGPU.device_id);
1004#endif
1005	}
1006	return 0;
1007}