{"id":13418198,"url":"https://github.com/clMathLibraries/clBLAS","last_synced_at":"2025-03-15T03:30:43.222Z","repository":{"id":10039707,"uuid":"12084767","full_name":"clMathLibraries/clBLAS","owner":"clMathLibraries","description":"a software library containing BLAS functions written in OpenCL","archived":false,"fork":false,"pushed_at":"2024-08-02T17:18:36.000Z","size":2915,"stargazers_count":838,"open_issues_count":96,"forks_count":242,"subscribers_count":92,"default_branch":"master","last_synced_at":"2024-08-30T23:26:36.788Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-08-13T15:05:53.000Z","updated_at":"2024-08-29T06:57:20.000Z","dependencies_parsed_at":"2024-10-26T14:06:41.009Z","dependency_job_id":"099bed85-f730-40d2-b2d0-6be70f1d3724","html_url":"https://github.com/clMathLibraries/clBLAS","commit_stats":{"total_commits":240,"total_committers":36,"mean_commits":6.666666666666667,"dds":0.6708333333333334,"last_synced_commit":"cf9113982fdfc994297d372785ce76eb80911af2"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clMathLibraries%2FclBLAS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clMathLibraries%2FclBLAS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clMathLibraries%2FclBLAS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clMathLibraries%2FclBLAS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clMathLibraries","download_url":"https://codeload.github.com/clMathLibraries/clBLAS/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243681024,"owners_count":20330152,"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-30T22:00:59.566Z","updated_at":"2025-03-15T03:30:43.207Z","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/clBLAS.svg?branch=master)](https://travis-ci.org/clMathLibraries/clBLAS/branches) | [![Build Status](https://travis-ci.org/clMathLibraries/clBLAS.svg?branch=develop)](https://travis-ci.org/clMathLibraries/clBLAS/branches) |\n| Visual Studio x64 | [![Build status](https://ci.appveyor.com/api/projects/status/v384bi6e8xv8nxjm/branch/master?svg=true)](https://ci.appveyor.com/project/kknox/clblas-5ph9i/branch/master)|[![Build status](https://ci.appveyor.com/api/projects/status/v384bi6e8xv8nxjm/branch/develop?svg=true)](https://ci.appveyor.com/project/kknox/clblas-5ph9i/branch/develop) |\n\nclBLAS\n=====\nThis repository houses the code for the OpenCL™ BLAS portion of clMath.\nThe complete set of BLAS level 1, 2 \u0026 3 routines is implemented. Please\nsee Netlib BLAS for the list of supported routines. In addition to GPU\ndevices, the library also supports running on CPU devices to facilitate\ndebugging and multicore programming. APPML 1.12 is the most current\ngenerally available pre-packaged binary version of the library available\nfor download for both Linux and Windows platforms.\n\nThe primary goal of clBLAS is to make it easier for developers to\nutilize the inherent performance and power efficiency benefits of\nheterogeneous computing. clBLAS interfaces do not hide nor wrap OpenCL\ninterfaces, but rather leaves OpenCL state management to the control of\nthe user to allow for maximum performance and flexibility. The clBLAS\nlibrary does generate and enqueue optimized OpenCL kernels, relieving\nthe user from the task of writing, optimizing and maintaining kernel\ncode themselves.\n\n## clBLAS update notes 01/2017\n\n- v2.12 is a bugfix release as a rollup of all fixes in /develop branch\n  - Thanks to @pavanky, @iotamudelta, @shahsan10, @psyhtest, @haahh, @hughperkins, @tfauck\n    @abhiShandy, @IvanVergiliev, @zougloub, @mgates3 for contributions to clBLAS v2.12\n- Summary of fixes available to read on the releases tab\n\n## clBLAS 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 have been created 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 itself\n\n## clBLAS Wiki\n\nThe [project wiki][] contains helpful documentation, including a [build\nprimer][]\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 should\nbe made against the /develop branch.\n\n## License\nThe source for clBLAS is licensed under the [Apache License, Version 2.0]( http://www.apache.org/licenses/LICENSE-2.0 )\n\n## Example\nThe simple example below shows how to use clBLAS to compute an OpenCL accelerated SGEMM\n\n```c\n    #include \u003csys/types.h\u003e\n    #include \u003cstdio.h\u003e\n\n    /* Include the clBLAS header. It includes the appropriate OpenCL headers */\n    #include \u003cclBLAS.h\u003e\n\n    /* This example uses predefined matrices and their characteristics for\n     * simplicity purpose.\n    */\n\n    #define M  4\n    #define N  3\n    #define K  5\n\n    static const cl_float alpha = 10;\n\n    static const cl_float A[M*K] = {\n    11, 12, 13, 14, 15,\n    21, 22, 23, 24, 25,\n    31, 32, 33, 34, 35,\n    41, 42, 43, 44, 45,\n    };\n    static const size_t lda = K;        /* i.e. lda = K */\n\n    static const cl_float B[K*N] = {\n    11, 12, 13,\n    21, 22, 23,\n    31, 32, 33,\n    41, 42, 43,\n    51, 52, 53,\n    };\n    static const size_t ldb = N;        /* i.e. ldb = N */\n\n    static const cl_float beta = 20;\n\n    static cl_float C[M*N] = {\n        11, 12, 13,\n        21, 22, 23,\n        31, 32, 33,\n        41, 42, 43,\n    };\n    static const size_t ldc = N;        /* i.e. ldc = N */\n\n    static cl_float result[M*N];\n\n    int 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 bufA, bufB, bufC;\n    cl_event event = NULL;\n    int ret = 0;\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 clBLAS */\n    err = clblasSetup( );\n\n    /* Prepare OpenCL memory objects and place matrices inside them. */\n    bufA = clCreateBuffer( ctx, CL_MEM_READ_ONLY, M * K * sizeof(*A),\n                          NULL, \u0026err );\n    bufB = clCreateBuffer( ctx, CL_MEM_READ_ONLY, K * N * sizeof(*B),\n                          NULL, \u0026err );\n    bufC = clCreateBuffer( ctx, CL_MEM_READ_WRITE, M * N * sizeof(*C),\n                          NULL, \u0026err );\n\n    err = clEnqueueWriteBuffer( queue, bufA, CL_TRUE, 0,\n        M * K * sizeof( *A ), A, 0, NULL, NULL );\n    err = clEnqueueWriteBuffer( queue, bufB, CL_TRUE, 0,\n        K * N * sizeof( *B ), B, 0, NULL, NULL );\n    err = clEnqueueWriteBuffer( queue, bufC, CL_TRUE, 0,\n        M * N * sizeof( *C ), C, 0, NULL, NULL );\n\n        /* Call clBLAS extended function. Perform gemm for the lower right sub-matrices */\n        err = clblasSgemm( clblasRowMajor, clblasNoTrans, clblasNoTrans,\n                                M, N, K,\n                                alpha, bufA, 0, lda,\n                                bufB, 0, ldb, beta,\n                                bufC, 0, ldc,\n                                1, \u0026queue, 0, NULL, \u0026event );\n\n    /* Wait for calculations to be finished. */\n    err = clWaitForEvents( 1, \u0026event );\n\n    /* Fetch results of calculations from GPU memory. */\n    err = clEnqueueReadBuffer( queue, bufC, CL_TRUE, 0,\n                                M * N * sizeof(*result),\n                                result, 0, NULL, NULL );\n\n    /* Release OpenCL memory objects. */\n    clReleaseMemObject( bufC );\n    clReleaseMemObject( bufB );\n    clReleaseMemObject( bufA );\n\n    /* Finalize work with clBLAS */\n    clblasTeardown( );\n\n    /* Release OpenCL working objects. */\n    clReleaseCommandQueue( queue );\n    clReleaseContext( ctx );\n\n    return ret;\n    }\n```\n\n## Build dependencies\n### Library for Windows\n*  Windows® 7/8\n*  Visual Studio 2010 SP1, 2012\n*  An OpenCL SDK, such as APP SDK 2.8\n*  Latest CMake\n\n### Library for Linux\n*  GCC 4.6 and onwards\n*  An OpenCL SDK, such as APP SDK 2.9\n*  Latest CMake\n\n### Library for Mac OSX\n*  Recommended to generate Unix makefiles with cmake\n\n### Test infrastructure\n*  Googletest v1.6\n*  Latest Boost\n*  CPU BLAS\n  - Netlib CBLAS (recommended)\n    Ubuntu: install by \"apt-get install libblas-dev\"\n    Windows: download \u0026 install lapack-3.6.0 which comes with CBLAS\n  - or ACML on windows/linux; Accelerate on Mac OSX\n\n### Performance infrastructure\n* Python\n\n  [Library and API documentation]: http://clmathlibraries.github.io/clBLAS/\n  [clmath@googlegroups.com]: https://groups.google.com/forum/#!forum/clmath\n  [clmath-developers@googlegroups.com]: https://groups.google.com/forum/#!forum/clmath-developers\n  [project wiki]: https://github.com/clMathLibraries/clBLAS/wiki\n  [build primer]: https://github.com/clMathLibraries/clBLAS/wiki/Build\n  [Contributing]: CONTRIBUTING.md\n  [Apache License, Version 2.0]: http://www.apache.org/licenses/LICENSE-2.0\n","funding_links":[],"categories":["TODO scan for Android support in followings","Numerical","OpenCL Tools, Libraries and Frameworks","数值","Libraries 🗂️","CUDA Tools Libraries, and Frameworks"],"sub_categories":["Advanced books","viii. Linear Regression","高级书籍","GPU Libraries ⚡"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FclMathLibraries%2FclBLAS","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FclMathLibraries%2FclBLAS","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FclMathLibraries%2FclBLAS/lists"}