Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add forward declarations and typedefs for exposed structures #192

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions vkFFT/vkFFT-fwd.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// This file is part of VkFFT, a Vulkan Fast Fourier Transform library
//
// Copyright (C) 2020 - present Dmitrii Tolmachev <[email protected]>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#ifndef VKFFT_FWD_H
#define VKFFT_FWD_H

// Forward declarations
struct VkFFTConfiguration;
struct VkFFTLaunchParams;
struct VkFFTApplication;

// Typedefs
typedef struct VkFFTConfiguration VkFFTConfiguration;
typedef struct VkFFTLaunchParams VkFFTLaunchParams;
typedef struct VkFFTApplication VkFFTApplication;

#endif // VKFFT_FWD_H
1 change: 1 addition & 0 deletions vkFFT/vkFFT.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@

#endif

#include "vkFFT-fwd.h"
#include "vkFFT/vkFFT_Structs/vkFFT_Structs.h"
#include "vkFFT/vkFFT_AppManagement/vkFFT_RunApp.h"
#include "vkFFT/vkFFT_AppManagement/vkFFT_InitializeApp.h"
Expand Down
12 changes: 6 additions & 6 deletions vkFFT/vkFFT/vkFFT_Structs/vkFFT_Structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ struct PfContainer{
int size; // bytes allcoated in name
};

typedef struct {
struct VkFFTConfiguration {
//WHDCN layout

//required parameters:
Expand Down Expand Up @@ -342,9 +342,9 @@ typedef struct {
MTL::CommandBuffer* commandBuffer;//Filled at app execution
MTL::ComputeCommandEncoder* commandEncoder;//Filled at app execution
#endif
} VkFFTConfiguration;//parameters specified at plan creation
};//parameters specified at plan creation

typedef struct {
struct VkFFTLaunchParams {
#if(VKFFT_BACKEND==0)
VkCommandBuffer* commandBuffer;//commandBuffer to which FFT is appended

Expand Down Expand Up @@ -404,7 +404,7 @@ typedef struct {
pfUINT inputBufferOffsetImaginary;//specify if VkFFT has to offset the first element position inside the input buffer. In bytes. Default 0
pfUINT outputBufferOffsetImaginary;//specify if VkFFT has to offset the first element position inside the output buffer. In bytes. Default 0
pfUINT kernelOffsetImaginary;//specify if VkFFT has to offset the first element position inside the kernel. In bytes. Default 0
} VkFFTLaunchParams;//parameters specified at plan execution
};//parameters specified at plan execution
typedef enum VkFFTResult {
VKFFT_SUCCESS = 0,
VKFFT_ERROR_MALLOC_FAILED = 1,
Expand Down Expand Up @@ -1186,7 +1186,7 @@ typedef struct {
VkFFTAxis R2Cdecomposition;
VkFFTAxis inverseBluesteinAxes[VKFFT_MAX_FFT_DIMENSIONS][4];
} VkFFTPlan;
typedef struct {
struct VkFFTApplication {
VkFFTConfiguration configuration;
VkFFTPlan* localFFTPlan;
VkFFTPlan* localFFTPlan_inverse; //additional inverse plan
Expand Down Expand Up @@ -1246,6 +1246,6 @@ typedef struct {

pfUINT applicationStringSize;//size of saveApplicationString in bytes
void* saveApplicationString;//memory array(uint32_t* for Vulkan, char* for CUDA/HIP/OpenCL) through which user can access VkFFT generated binaries. (will be allocated by VkFFT, deallocated with deleteVkFFT call)
} VkFFTApplication;
};

#endif