{"id":13398116,"url":"https://github.com/clMathLibraries/clFFT","last_synced_at":"2025-03-14T02:30:43.755Z","repository":{"id":10039730,"uuid":"12084795","full_name":"clMathLibraries/clFFT","owner":"clMathLibraries","description":"a software library containing FFT functions written in OpenCL","archived":false,"fork":false,"pushed_at":"2022-10-05T14:15:49.000Z","size":2912,"stargazers_count":618,"open_issues_count":40,"forks_count":196,"subscribers_count":80,"default_branch":"master","last_synced_at":"2024-09-30T23:09:36.015Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/clMathLibraries.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-08-13T15:07:15.000Z","updated_at":"2024-09-25T06:11:08.000Z","dependencies_parsed_at":"2022-09-13T08:12:12.242Z","dependency_job_id":null,"html_url":"https://github.com/clMathLibraries/clFFT","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clMathLibraries%2FclFFT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clMathLibraries%2FclFFT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clMathLibraries%2FclFFT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clMathLibraries%2FclFFT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clMathLibraries","download_url":"https://codeload.github.com/clMathLibraries/clFFT/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221428904,"owners_count":16819247,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T19:00:17.258Z","updated_at":"2024-10-25T13:31:05.927Z","avatar_url":"https://github.com/clMathLibraries.png","language":"C++","readme":"﻿## Build Status\n| Build branch | master | develop |\n|-----|-----|-----|\n| GCC/Clang x64 | [![Build Status](https://travis-ci.org/clMathLibraries/clFFT.svg?branch=master)](https://travis-ci.org/clMathLibraries/clFFT/branches) | [![Build Status](https://travis-ci.org/clMathLibraries/clFFT.svg?branch=develop)](https://travis-ci.org/clMathLibraries/clFFT/branches) |\n| Visual Studio x64 |  |[![Build status](https://ci.appveyor.com/api/projects/status/facii32v72y98opv/branch/develop?svg=true)](https://ci.appveyor.com/project/kknox/clfft-whc3m/branch/develop) |\n\nclFFT\n=====\nclFFT is a software library containing FFT functions written\nin OpenCL. In addition to GPU devices, the library also supports\nrunning on CPU devices to facilitate debugging and heterogeneous\nprogramming.\n\nPre-built binaries are available [here][binary_release].\n\n## What's New\n\n-   Support for powers of 11\u002613 size transforms\n-   Support for 1D large size transforms with no extra memory allocation\n    requirement with environment flag CLFFT_REQUEST_LIB_NOMEMALLOC=1\n    for complex FFTs of powers of 2,3,5,10 sizes\n\n\n## Note\n\n-   clFFT requires platform/runtime that supports OpenCL 1.2\n\n## Introduction to clFFT\n\nThe FFT is an implementation of the Discrete Fourier Transform (DFT)\nthat makes use of symmetries in the FFT definition to reduce the\nmathematical intensity required from O(N^2) to O(N log2(N)) when the\nsequence length N is the product of small prime factors. Currently,\nthere is no standard API for FFT routines. Hardware vendors usually\nprovide a set of high-performance FFTs optimized for their systems: no\ntwo vendors employ the same interfaces for their FFT routines. clFFT\nprovides a set of FFT routines that are optimized for AMD graphics\nprocessors, but also are functional across CPU and other compute\ndevices.\n\nThe clFFT library is an open source OpenCL library implementation of\ndiscrete Fast Fourier Transforms. The library:\n\n-   provides a fast and accurate platform for calculating discrete FFTs.\n\n-   works on CPU or GPU backends.\n\n-   supports in-place or out-of-place transforms.\n\n-   supports 1D, 2D, and 3D transforms with a batch size that can be\n    greater than 1.\n\n-   supports planar (real and complex components in separate arrays) and\n    interleaved (real and complex components as a pair contiguous in\n    memory) formats.\n\n-   supports dimension lengths that can be any combination of powers of\n    2, 3, 5, 7, 11 and 13.\n\n-   Supports single and double precision floating point formats.\n\n## clFFT library user documentation\n\n[Library and API documentation][] for developers is available online as\na GitHub Pages website\n\n### Google Groups\n\nTwo mailing lists exist for the clMath projects:\n\n-   [clmath@googlegroups.com][] - group whose focus is to answer\n    questions on using the library or reporting issues\n\n-   [clmath-developers@googlegroups.com][] - group whose focus is for\n    developers interested in contributing to the library code\n\n### API semantic versioning\nGood software is typically the result of the loop of feedback and iteration; software \ninterfaces no less so. clFFT follows the [semantic versioning] guidelines. The version\nnumber used is of the form MAJOR.MINOR.PATCH.\n\n## clFFT Wiki\n\nThe [project wiki][clmath@googlegroups.com] contains helpful\ndocumentation, including a [build\nprimer][clmath-developers@googlegroups.com]\n\n## Contributing code\n\nPlease refer to and read the [Contributing][] document for guidelines on\nhow to contribute code to this open source project. The code in the\n/master branch is considered to be stable, and all pull-requests must\nbe made against the /develop branch.\n\n## License\n\nThe source for clFFT is licensed under the [Apache License, Version\n2.0][]\n\n## Example\n\nThe following simple example shows how to use clFFT to compute a simple 1D\nforward transform\n```c\n#include \u003cstdlib.h\u003e\n\n/* No need to explicitely include the OpenCL headers */\n#include \u003cclFFT.h\u003e\n\nint main( void )\n{\n    cl_int err;\n    cl_platform_id platform = 0;\n    cl_device_id device = 0;\n    cl_context_properties props[3] = { CL_CONTEXT_PLATFORM, 0, 0 };\n    cl_context ctx = 0;\n    cl_command_queue queue = 0;\n    cl_mem bufX;\n\tfloat *X;\n    cl_event event = NULL;\n    int ret = 0;\n\tsize_t N = 16;\n\n\t/* FFT library realted declarations */\n\tclfftPlanHandle planHandle;\n\tclfftDim dim = CLFFT_1D;\n\tsize_t clLengths[1] = {N};\n\n    /* Setup OpenCL environment. */\n    err = clGetPlatformIDs( 1, \u0026platform, NULL );\n    err = clGetDeviceIDs( platform, CL_DEVICE_TYPE_GPU, 1, \u0026device, NULL );\n\n    props[1] = (cl_context_properties)platform;\n    ctx = clCreateContext( props, 1, \u0026device, NULL, NULL, \u0026err );\n    queue = clCreateCommandQueue( ctx, device, 0, \u0026err );\n\n    /* Setup clFFT. */\n\tclfftSetupData fftSetup;\n\terr = clfftInitSetupData(\u0026fftSetup);\n\terr = clfftSetup(\u0026fftSetup);\n\n\t/* Allocate host \u0026 initialize data. */\n\t/* Only allocation shown for simplicity. */\n\tX = (float *)malloc(N * 2 * sizeof(*X));\n\n    /* Prepare OpenCL memory objects and place data inside them. */\n    bufX = clCreateBuffer( ctx, CL_MEM_READ_WRITE, N * 2 * sizeof(*X), NULL, \u0026err );\n\n    err = clEnqueueWriteBuffer( queue, bufX, CL_TRUE, 0,\n\tN * 2 * sizeof( *X ), X, 0, NULL, NULL );\n\n\t/* Create a default plan for a complex FFT. */\n\terr = clfftCreateDefaultPlan(\u0026planHandle, ctx, dim, clLengths);\n\n\t/* Set plan parameters. */\n\terr = clfftSetPlanPrecision(planHandle, CLFFT_SINGLE);\n\terr = clfftSetLayout(planHandle, CLFFT_COMPLEX_INTERLEAVED, CLFFT_COMPLEX_INTERLEAVED);\n\terr = clfftSetResultLocation(planHandle, CLFFT_INPLACE);\n\n    /* Bake the plan. */\n\terr = clfftBakePlan(planHandle, 1, \u0026queue, NULL, NULL);\n\n\t/* Execute the plan. */\n\terr = clfftEnqueueTransform(planHandle, CLFFT_FORWARD, 1, \u0026queue, 0, NULL, NULL, \u0026bufX, NULL, NULL);\n\n\t/* Wait for calculations to be finished. */\n\terr = clFinish(queue);\n\n\t/* Fetch results of calculations. */\n\terr = clEnqueueReadBuffer( queue, bufX, CL_TRUE, 0, N * 2 * sizeof( *X ), X, 0, NULL, NULL );\n\n    /* Release OpenCL memory objects. */\n    clReleaseMemObject( bufX );\n\n\tfree(X);\n\n\t/* Release the plan. */\n\terr = clfftDestroyPlan( \u0026planHandle );\n\n    /* Release clFFT library. */\n    clfftTeardown( );\n\n    /* Release OpenCL working objects. */\n    clReleaseCommandQueue( queue );\n    clReleaseContext( ctx );\n\n    return ret;\n}\n```\n\n## Build dependencies\n\n### Library for Windows   \nTo develop the clFFT library code on a Windows operating system, ensure to install the following packages on your system:\n\n-   Windows® 7/8.1\n\n-   Visual Studio 2012 or later\n\n-   Latest CMake\n\n-   An OpenCL SDK, such as APP SDK 3.0\n\n### Library for Linux\nTo develop the clFFT library code on a Linux operating system, ensure to install the following packages on your system:\n-   GCC 4.6 and onwards\n\n-   Latest CMake\n\n-   An OpenCL SDK, such as APP SDK 3.0\n\n### Library for Mac OSX\nTo develop the clFFT library code on a Mac OS X, it is recommended to generate Unix makefiles with cmake.\n\n### Test infrastructure\nTo test the developed clFFT library code, ensure to install the following packages on your system:\n\n-   Googletest v1.6\n\n-   Latest FFTW\n\n-   Latest Boost\n\n### Performance infrastructure\nTo measure the performance of the clFFT library code, ensure that the Python package is installed on your system.\n\n  [Library and API documentation]: http://clmathlibraries.github.io/clFFT/\n  [clmath@googlegroups.com]: https://github.com/clMathLibraries/clFFT/wiki\n  [clmath-developers@googlegroups.com]: https://github.com/clMathLibraries/clFFT/wiki/Build\n  [Contributing]: CONTRIBUTING.md\n  [Apache License, Version 2.0]: http://www.apache.org/licenses/LICENSE-2.0\n  [binary_release]: https://github.com/clMathLibraries/clFFT/releases\n  [semantic versioning]: http://semver.org/","funding_links":[],"categories":["C++","TODO scan for Android support in followings","OpenCL Tools, Libraries and Frameworks","CUDA Tools Libraries, and Frameworks"],"sub_categories":["viii. Linear Regression"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FclMathLibraries%2FclFFT","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FclMathLibraries%2FclFFT","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FclMathLibraries%2FclFFT/lists"}