-
Notifications
You must be signed in to change notification settings - Fork 4
Layer MVP #14
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
Open
MathiasMagnus
wants to merge
22
commits into
kpet:main
Choose a base branch
from
MathiasMagnus:layer
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Layer MVP #14
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
bbaf66a
Initial layer implementation
MathiasMagnus 0c1006f
Dead-code elimination
MathiasMagnus 9755866
New-line at end of file
MathiasMagnus a4bdb0a
Port layerloadtest to C API
MathiasMagnus c609e7e
Apply clang-format to tests
MathiasMagnus 5659f1b
Add OpenCL-ICD-Loader as submodule
MathiasMagnus 377c6a4
Move to self-hosted ICD-Loader instead of dep
MathiasMagnus 631c8db
Add missing header
MathiasMagnus 36fc474
Add missing header
MathiasMagnus 3cff665
Fix linkage
MathiasMagnus d9b1992
Add running tests
MathiasMagnus be7dca1
Initialize _objects
MathiasMagnus 175316f
Configure using MSbuild on Windows
MathiasMagnus f08034e
condition fix
MathiasMagnus eef482e
CI
MathiasMagnus de9431a
properly pick build-config
MathiasMagnus b549f73
Fix Windows CI
MathiasMagnus e939ea8
Move to system-layers branch
MathiasMagnus 620c485
proper config definition
MathiasMagnus 55bfe85
output on failure
MathiasMagnus 40cd2b6
Fix reg path
MathiasMagnus 5d34614
Install the built config
MathiasMagnus 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
Submodule OpenCL-ICD-Loader
added at
bba750
Submodule SPIRV-Tools
updated
6 files
| +9 −0 | source/val/decoration.h | |
| +2 −2 | source/val/validate_annotation.cpp | |
| +35 −28 | source/val/validate_decorations.cpp | |
| +6 −8 | source/val/validate_memory.cpp | |
| +34 −14 | source/val/validation_state.h | |
| +10 −10 | test/val/val_decoration_test.cpp |
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,105 @@ | ||
| #pragma once | ||
|
|
||
| #include <CL/cl_layer.h> | ||
|
|
||
| #include <map> | ||
| #include <memory> | ||
| #include <string> | ||
|
|
||
| namespace spirv2clc { | ||
| class layer { | ||
| public: | ||
| layer() noexcept; | ||
| layer(const layer &) = delete; | ||
| layer(layer &&) = delete; | ||
| ~layer() = default; | ||
| layer &operator=(const layer &) = delete; | ||
| layer &operator=(layer &&) = delete; | ||
|
|
||
| cl_icd_dispatch &get_dispatch(); | ||
| const cl_icd_dispatch *get_target_dispatch(); | ||
|
|
||
| cl_int clGetPlatformInfo(cl_platform_id platform, cl_platform_info param_name, | ||
| size_t param_value_size, void *param_value, | ||
| size_t *param_value_size_ret); | ||
|
|
||
| cl_int clGetDeviceInfo(cl_device_id device, cl_device_info param_name, | ||
| size_t param_value_size, void *param_value, | ||
| size_t *param_value_size_ret); | ||
|
|
||
| cl_program clCreateProgramWithIL(cl_context context, const void *il, | ||
| size_t length, cl_int *errcode_ret); | ||
|
|
||
| cl_int clBuildProgram(cl_program program, cl_uint num_devices, | ||
| const cl_device_id *device_list, const char *options, | ||
| void(CL_CALLBACK *pfn_notify)(cl_program program, | ||
| void *user_data), | ||
| void *user_data); | ||
|
|
||
| cl_int clGetProgramInfo(cl_program program, cl_program_info param_name, | ||
| size_t param_value_size, void *param_value, | ||
| size_t *param_value_size_ret); | ||
|
|
||
| std::map<cl_program, std::pair<std::string, std::string>> program_ils; | ||
|
|
||
| bool tracing; | ||
|
|
||
| private: | ||
| void init_dispatch(void); | ||
|
|
||
| cl_int clGetPlatformInfo_CL_PLATFORM_EXTENSIONS(cl_platform_id platform, | ||
| cl_platform_info param_name, | ||
| size_t param_value_size, | ||
| void *param_value, | ||
| size_t *param_value_size_ret); | ||
|
|
||
| cl_int clGetDeviceInfo_CL_DEVICE_EXTENSIONS(cl_device_id device, | ||
| cl_device_info param_name, | ||
| size_t param_value_size, | ||
| void *param_value, | ||
| size_t *param_value_size_ret); | ||
|
|
||
| cl_int clGetDeviceInfo_CL_DEVICE_IL_VERSION(cl_device_id device, | ||
| cl_device_info param_name, | ||
| size_t param_value_size, | ||
| void *param_value, | ||
| size_t *param_value_size_ret); | ||
|
|
||
| cl_int clGetDeviceInfo_CL_DEVICE_ILS_WITH_VERSION( | ||
| cl_device_id device, cl_device_info param_name, size_t param_value_size, | ||
| void *param_value, size_t *param_value_size_ret); | ||
|
|
||
| cl_int clGetProgramInfo_CL_PROGRAM_IL(cl_program program, | ||
| cl_program_info param_name, | ||
| size_t param_value_size, | ||
| void *param_value, | ||
| size_t *param_value_size_ret); | ||
| }; | ||
|
|
||
| inline layer instance; | ||
| inline const cl_icd_dispatch *tdispatch = nullptr; | ||
| inline cl_icd_dispatch dispatch{}; | ||
|
|
||
| } // namespace spirv2clc | ||
|
|
||
| // internal tracing macros | ||
| #define SPIRV2CLC_TRACE(...) \ | ||
| do { \ | ||
| if (spirv2clc::instance.tracing) { \ | ||
| fprintf(stderr, "SPIRV2CLC trace at %s:%d: ", __FILE__, __LINE__); \ | ||
| fprintf(stderr, __VA_ARGS__); \ | ||
| } \ | ||
| } while (0) | ||
|
|
||
| #ifdef _WIN32 | ||
| #define SPIRV2CLC_WIDE_TRACE(...) \ | ||
| do { \ | ||
| if (spirv2clc::instance.tracing) { \ | ||
| fwprintf(stderr, L"SPIRV2CLC trace at %hs:%d: ", __FILE__, __LINE__); \ | ||
| fwprintf(stderr, __VA_ARGS__); \ | ||
| } \ | ||
| } while (0) | ||
|
|
||
| #else | ||
| #define SPIRV2CLC_WIDE_TRACE(...) | ||
| #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,36 @@ | ||
| #pragma once | ||
|
|
||
| #include <CL/cl_layer.h> | ||
|
|
||
| CL_API_ENTRY cl_int CL_API_CALL clGetLayerInfo(cl_layer_info param_name, | ||
| size_t param_value_size, | ||
| void *param_value, | ||
| size_t *param_value_size_ret); | ||
|
|
||
| CL_API_ENTRY cl_int CL_API_CALL clInitLayer( | ||
| cl_uint num_entries, const _cl_icd_dispatch *target_dispatch, | ||
| cl_uint *num_entries_out, const _cl_icd_dispatch **layer_dispatch_ret); | ||
|
|
||
| CL_API_ENTRY cl_int CL_API_CALL clGetPlatformInfo_wrap( | ||
| cl_platform_id platform, cl_platform_info param_name, | ||
| size_t param_value_size, void *param_value, size_t *param_value_size_ret); | ||
|
|
||
| CL_API_ENTRY cl_int CL_API_CALL clGetDeviceInfo_wrap( | ||
| cl_device_id device, cl_device_info param_name, size_t param_value_size, | ||
| void *param_value, size_t *param_value_size_ret); | ||
|
|
||
| CL_API_ENTRY cl_program CL_API_CALL clCreateProgramWithIL_wrap( | ||
| cl_context context, const void *il, size_t length, cl_int *errcode_ret); | ||
|
|
||
| CL_API_ENTRY cl_program CL_API_CALL clCreateProgramWithILKHR_wrap( | ||
| cl_context context, const void *il, size_t length, cl_int *errcode_ret); | ||
|
|
||
| CL_API_ENTRY cl_int CL_API_CALL clBuildProgram_wrap( | ||
| cl_program program, cl_uint num_devices, const cl_device_id *device_list, | ||
| const char *options, | ||
| void(CL_CALLBACK *pfn_notify)(cl_program program, void *user_data), | ||
| void *user_data); | ||
|
|
||
| CL_API_ENTRY cl_int CL_API_CALL clGetProgramInfo_wrap( | ||
| cl_program program, cl_program_info param_name, size_t param_value_size, | ||
| void *param_value, size_t *param_value_size_ret); |
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
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.