-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
1,751 additions
and
5,380 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* The MIT License (MIT) | ||
* | ||
* Copyright (c) 2014-2018 David Medina and Tim Warburton | ||
* | ||
* 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 | ||
*/ | ||
#ifndef OCCA_C_DEFINES_HEADER | ||
#define OCCA_C_DEFINES_HEADER | ||
|
||
#include "occa/defines.hpp" | ||
|
||
#if (OCCA_OS & (OCCA_LINUX_OS | OCCA_OSX_OS)) | ||
# define OCCA_RFUNC | ||
# define OCCA_LFUNC | ||
#else | ||
# define OCCA_RFUNC __stdcall | ||
# ifdef OCCA_C_EXPORTS | ||
// #define OCCA_LFUNC __declspec(dllexport) | ||
# define OCCA_LFUNC | ||
# else | ||
// #define OCCA_LFUNC __declspec(dllimport) | ||
# define OCCA_LFUNC | ||
# endif | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
/* The MIT License (MIT) | ||
* | ||
* Copyright (c) 2014-2018 David Medina and Tim Warburton | ||
* | ||
* 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 | ||
*/ | ||
|
||
#ifndef OCCA_C_DEVICE_HEADER | ||
#define OCCA_C_DEVICE_HEADER | ||
|
||
#include "occa/c/defines.h" | ||
#include "occa/c/types.h" | ||
|
||
OCCA_START_EXTERN_C | ||
|
||
//---[ Background ]--------------------- | ||
OCCA_LFUNC void OCCA_RFUNC occaSetDevice(occaDevice device); | ||
|
||
OCCA_LFUNC void OCCA_RFUNC occaSetDeviceFromInfo(const char *infos); | ||
|
||
OCCA_LFUNC void OCCA_RFUNC occaFinish(); | ||
|
||
OCCA_LFUNC void OCCA_RFUNC occaWaitFor(occaStreamTag tag); | ||
|
||
OCCA_LFUNC occaStream OCCA_RFUNC occaCreateStream(); | ||
|
||
OCCA_LFUNC occaStream OCCA_RFUNC occaGetStream(); | ||
|
||
OCCA_LFUNC void OCCA_RFUNC occaSetStream(occaStream stream); | ||
|
||
OCCA_LFUNC occaStream OCCA_RFUNC occaWrapStream(void *handle_, | ||
const occaProperties props); | ||
|
||
OCCA_LFUNC occaStreamTag OCCA_RFUNC occaTagStream(); | ||
//====================================== | ||
|
||
OCCA_LFUNC void OCCA_RFUNC occaPrintModeInfo(); | ||
|
||
OCCA_LFUNC occaDevice OCCA_RFUNC occaCreateDevice(occaType info); | ||
|
||
OCCA_LFUNC const char* OCCA_RFUNC occaDeviceMode(occaDevice device); | ||
|
||
OCCA_LFUNC occaUDim_t OCCA_RFUNC occaDeviceMemorySize(occaDevice device); | ||
|
||
OCCA_LFUNC occaUDim_t OCCA_RFUNC occaDeviceMemoryAllocated(occaDevice device); | ||
|
||
OCCA_LFUNC occaUDim_t OCCA_RFUNC occaDeviceBytesAllocated(occaDevice device); | ||
|
||
OCCA_LFUNC occaKernel OCCA_RFUNC occaDeviceBuildKernel(occaDevice device, | ||
const char *filename, | ||
const char *kernelName, | ||
const occaProperties props); | ||
|
||
OCCA_LFUNC occaKernel OCCA_RFUNC occaDeviceBuildKernelFromString(occaDevice device, | ||
const char *str, | ||
const char *kernelName, | ||
const occaProperties props); | ||
|
||
OCCA_LFUNC occaKernel OCCA_RFUNC occaDeviceBuildKernelFromBinary(occaDevice device, | ||
const char *filename, | ||
const char *kernelName, | ||
const occaProperties props); | ||
|
||
OCCA_LFUNC occaMemory OCCA_RFUNC occaDeviceMalloc(occaDevice device, | ||
const occaUDim_t bytes, | ||
const void *src, | ||
occaProperties props); | ||
|
||
OCCA_LFUNC void* OCCA_RFUNC occaDeviceUmalloc(occaDevice device, | ||
const occaUDim_t bytes, | ||
const void *src, | ||
occaProperties props); | ||
|
||
OCCA_LFUNC void OCCA_RFUNC occaDeviceFinish(occaDevice device); | ||
|
||
OCCA_LFUNC occaStream OCCA_RFUNC occaDeviceCreateStream(occaDevice device); | ||
|
||
OCCA_LFUNC occaStream OCCA_RFUNC occaDeviceGetStream(occaDevice device); | ||
|
||
OCCA_LFUNC void OCCA_RFUNC occaDeviceSetStream(occaDevice device, | ||
occaStream stream); | ||
|
||
OCCA_LFUNC occaStream OCCA_RFUNC occaDeviceWrapStream(occaDevice device, | ||
void *handle_, | ||
const occaProperties props); | ||
|
||
OCCA_LFUNC occaStreamTag OCCA_RFUNC occaDeviceTagStream(occaDevice device); | ||
|
||
OCCA_LFUNC void OCCA_RFUNC occaDeviceWaitForTag(occaDevice device, | ||
occaStreamTag tag); | ||
|
||
OCCA_LFUNC double OCCA_RFUNC occaDeviceTimeBetweenTags(occaDevice device, | ||
occaStreamTag startTag, | ||
occaStreamTag endTag); | ||
|
||
OCCA_END_EXTERN_C | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* The MIT License (MIT) | ||
* | ||
* Copyright (c) 2014-2018 David Medina and Tim Warburton | ||
* | ||
* 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 | ||
*/ | ||
|
||
#ifndef OCCA_C_KERNEL_HEADER | ||
#define OCCA_C_KERNEL_HEADER | ||
|
||
#include "occa/c/defines.h" | ||
#include "occa/c/types.h" | ||
|
||
OCCA_START_EXTERN_C | ||
|
||
//---[ Background ]--------------------- | ||
OCCA_LFUNC occaKernel OCCA_RFUNC occaBuildKernel(const char *filename, | ||
const char *kernelName, | ||
const occaProperties props); | ||
|
||
OCCA_LFUNC occaKernel OCCA_RFUNC occaBuildKernelFromString(const char *str, | ||
const char *kernelName, | ||
const occaProperties props); | ||
|
||
OCCA_LFUNC occaKernel OCCA_RFUNC occaBuildKernelFromBinary(const char *filename, | ||
const char *kernelName, | ||
const occaProperties props); | ||
//====================================== | ||
|
||
OCCA_LFUNC const char* OCCA_RFUNC occaKernelMode(occaKernel kernel); | ||
OCCA_LFUNC const char* OCCA_RFUNC occaKernelName(occaKernel kernel); | ||
|
||
OCCA_LFUNC occaDevice OCCA_RFUNC occaKernelGetDevice(occaKernel kernel); | ||
|
||
OCCA_LFUNC void OCCA_RFUNC occaKernelSetRunDims(occaKernel kernel, | ||
occaDim groups, | ||
occaDim items); | ||
|
||
OCCA_LFUNC void OCCA_RFUNC occaKernelRunN(occaKernel kernel, | ||
const int argc, | ||
...); | ||
|
||
OCCA_END_EXTERN_C | ||
|
||
#endif |
Oops, something went wrong.