Giter Site home page Giter Site logo

solve-poisson-equation-using-cuda-fft's Introduction

Solve Poisson equation using CUDA FFT

When using Visual studio, click right button on your project name. Then click on properties.

Then configuration properties, linker, input. In additional dependencies you must write cufft.lib.

Poisson equation

image

In Mathematical Methods of Physics, a Poisson quation can be solved using Fourier transform (or Laplace tranform)

image

How to use FFT with CUDA(for example, with 1-D):

Firstly, include headfile for FFT

#include <cuda.h>

#include <cufft.h>

#include "cuda_runtime.h"

#include "device_launch_parameters.h"

cufftHandle plan; // create cuFFT handle

cufftPlan1d(&plan, N, CUFFT_C2C, BATCH); // N here is the length of data, CUFFT_C2C is from complex to complex; Batch execution for multiple transforms,or use cufftPlanMany() instead.

cufftExecC2C(plan, data_dev, data_dev, CUFFT_FORWARD); //the first data_dev is the address of input data, and the second data_dev is address of output data result

// excute cuFFT with forwad FFT, CUFFT_INVERSE is inverse FFT.Watch out: InverseFFT needs to be diveded by N after execution.

solve-poisson-equation-using-cuda-fft's People

Contributors

wangjinlong9788 avatar

Watchers

 avatar  avatar

Forkers

whpy

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.