-
Notifications
You must be signed in to change notification settings - Fork 796
[libclc] Create an internal 'clc' builtins library #15921
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,2 @@ | ||
| #define __CLC_BODY <clc/geometric/clc_dot.inc> | ||
| #include <clc/geometric/floatn.inc> |
This file contains hidden or 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 @@ | ||
| _CLC_OVERLOAD _CLC_DECL __CLC_FLOAT __clc_dot(__CLC_FLOATN p0, __CLC_FLOATN p1); |
This file contains hidden or 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,26 @@ | ||
| #ifndef __CLC_INTERNAL_CLC_H_ | ||
| #define __CLC_INTERNAL_CLC_H_ | ||
|
|
||
| #ifndef cl_clang_storage_class_specifiers | ||
| #error Implementation requires cl_clang_storage_class_specifiers extension! | ||
| #endif | ||
|
|
||
| #pragma OPENCL EXTENSION cl_clang_storage_class_specifiers : enable | ||
|
|
||
| #ifdef cl_khr_fp64 | ||
| #pragma OPENCL EXTENSION cl_khr_fp64 : enable | ||
| #endif | ||
|
|
||
| #ifdef cl_khr_fp16 | ||
| #pragma OPENCL EXTENSION cl_khr_fp16 : enable | ||
| #endif | ||
|
|
||
| /* Function Attributes */ | ||
| #include <clc/clcfunc.h> | ||
|
|
||
| /* 6.1 Supported Data Types */ | ||
| #include <clc/clctypes.h> | ||
|
|
||
| #pragma OPENCL EXTENSION all : disable | ||
|
|
||
| #endif // __CLC_INTERNAL_CLC_H_ |
This file contains hidden or 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 @@ | ||
| dummy.cl |
This file contains hidden or 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 @@ | ||
| // Empty file |
This file contains hidden or 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 @@ | ||
| clspv | ||
This file contains hidden or 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 @@ | ||
| geometric/clc_dot.cl |
This file contains hidden or 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,57 @@ | ||
| #include <clc/internal/clc.h> | ||
|
|
||
| _CLC_OVERLOAD _CLC_DEF float __clc_dot(float p0, float p1) { return p0 * p1; } | ||
|
|
||
| _CLC_OVERLOAD _CLC_DEF float __clc_dot(float2 p0, float2 p1) { | ||
| return p0.x * p1.x + p0.y * p1.y; | ||
| } | ||
|
|
||
| _CLC_OVERLOAD _CLC_DEF float __clc_dot(float3 p0, float3 p1) { | ||
| return p0.x * p1.x + p0.y * p1.y + p0.z * p1.z; | ||
| } | ||
|
|
||
| _CLC_OVERLOAD _CLC_DEF float __clc_dot(float4 p0, float4 p1) { | ||
| return p0.x * p1.x + p0.y * p1.y + p0.z * p1.z + p0.w * p1.w; | ||
| } | ||
|
|
||
| #ifdef cl_khr_fp64 | ||
|
|
||
| #pragma OPENCL EXTENSION cl_khr_fp64 : enable | ||
|
|
||
| _CLC_OVERLOAD _CLC_DEF double __clc_dot(double p0, double p1) { | ||
| return p0 * p1; | ||
| } | ||
|
|
||
| _CLC_OVERLOAD _CLC_DEF double __clc_dot(double2 p0, double2 p1) { | ||
| return p0.x * p1.x + p0.y * p1.y; | ||
| } | ||
|
|
||
| _CLC_OVERLOAD _CLC_DEF double __clc_dot(double3 p0, double3 p1) { | ||
| return p0.x * p1.x + p0.y * p1.y + p0.z * p1.z; | ||
| } | ||
|
|
||
| _CLC_OVERLOAD _CLC_DEF double __clc_dot(double4 p0, double4 p1) { | ||
| return p0.x * p1.x + p0.y * p1.y + p0.z * p1.z + p0.w * p1.w; | ||
| } | ||
|
|
||
| #endif | ||
|
|
||
| #ifdef cl_khr_fp16 | ||
|
|
||
| #pragma OPENCL EXTENSION cl_khr_fp16 : enable | ||
|
|
||
| _CLC_OVERLOAD _CLC_DEF half __clc_dot(half p0, half p1) { return p0 * p1; } | ||
|
|
||
| _CLC_OVERLOAD _CLC_DEF half __clc_dot(half2 p0, half2 p1) { | ||
| return p0.x * p1.x + p0.y * p1.y; | ||
| } | ||
|
|
||
| _CLC_OVERLOAD _CLC_DEF half __clc_dot(half3 p0, half3 p1) { | ||
| return p0.x * p1.x + p0.y * p1.y + p0.z * p1.z; | ||
| } | ||
|
|
||
| _CLC_OVERLOAD _CLC_DEF half __clc_dot(half4 p0, half4 p1) { | ||
| return p0.x * p1.x + p0.y * p1.y + p0.z * p1.z + p0.w * p1.w; | ||
| } | ||
|
|
||
| #endif |
This file contains hidden or 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,2 @@ | ||
| ../generic/geometric/clc_dot.cl | ||
|
|
This file contains hidden or 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 @@ | ||
| ../generic/geometric/clc_dot.cl |
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.