Skip to content

Commit

Permalink
Merge pull request #95 from 0x0f0f0f/master
Browse files Browse the repository at this point in the history
replaced "static unsigned const" to "static const unsigned" to avoid SWIG parsing error.
  • Loading branch information
axsaucedo committed Nov 9, 2020
2 parents 92338f7 + 8a0c63c commit 562c6e8
Show file tree
Hide file tree
Showing 6 changed files with 126 additions and 126 deletions.
4 changes: 2 additions & 2 deletions scripts/convert_shaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ def run_cli(
for file in spirv_files:
print(xxd_cmd)
header_data = str(run_cmd(xxd_cmd, "-i", file))
# Ensuring the variable is a static unsigned const
header_data = header_data.replace("unsigned", "static unsigned const")
# Ensuring the variable is a static const unsigned
header_data = header_data.replace("unsigned", "static const unsigned")
if is_windows:
raw_file_name = file.split("\\")[-1]
else:
Expand Down
8 changes: 4 additions & 4 deletions single_include/kompute/Kompute.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ static const char* KOMPUTE_LOG_TAG = "KomputeLog";

namespace kp {
namespace shader_data {
static unsigned const char shaders_glsl_opmult_comp_spv[] = {
static const unsigned char shaders_glsl_opmult_comp_spv[] = {
0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x08, 0x00,
0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00,
0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00,
Expand Down Expand Up @@ -232,7 +232,7 @@ static unsigned const char shaders_glsl_opmult_comp_spv[] = {
0x17, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x28, 0x00, 0x00, 0x00,
0x27, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00
};
static unsigned const int shaders_glsl_opmult_comp_spv_len = 1464;
static const unsigned int shaders_glsl_opmult_comp_spv_len = 1464;
}
}
#endif // define SHADEROP_SHADEROPMULT_HPP
Expand Down Expand Up @@ -262,7 +262,7 @@ static unsigned const int shaders_glsl_opmult_comp_spv_len = 1464;

namespace kp {
namespace shader_data {
static unsigned const char shaders_glsl_logisticregression_comp_spv[] = {
static const unsigned char shaders_glsl_logisticregression_comp_spv[] = {
0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x08, 0x00,
0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00,
0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00,
Expand Down Expand Up @@ -674,7 +674,7 @@ static unsigned const char shaders_glsl_logisticregression_comp_spv[] = {
0x06, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00,
0xfe, 0x00, 0x02, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x38, 0x00, 0x01, 0x00
};
static unsigned const int shaders_glsl_logisticregression_comp_spv_len = 4920;
static const unsigned int shaders_glsl_logisticregression_comp_spv_len = 4920;
}
}
#endif // define SHADEROP_SHADERLOGISTICREGRESSION_HPP
Expand Down
60 changes: 30 additions & 30 deletions src/include/kompute/shaders/shaderlogisticregression.hpp
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
/*
THIS FILE HAS BEEN AUTOMATICALLY GENERATED - DO NOT EDIT
---
Copyright 2020 The Institute for Ethical AI & Machine Learning
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

#ifndef SHADEROP_SHADERLOGISTICREGRESSION_HPP
#define SHADEROP_SHADERLOGISTICREGRESSION_HPP

namespace kp {
namespace shader_data {
static unsigned const char shaders_glsl_logisticregression_comp_spv[] = {
/*
THIS FILE HAS BEEN AUTOMATICALLY GENERATED - DO NOT EDIT
---
Copyright 2020 The Institute for Ethical AI & Machine Learning
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

#ifndef SHADEROP_SHADERLOGISTICREGRESSION_HPP
#define SHADEROP_SHADERLOGISTICREGRESSION_HPP

namespace kp {
namespace shader_data {
static const unsigned char shaders_glsl_logisticregression_comp_spv[] = {
0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x08, 0x00,
0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00,
0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00,
Expand Down Expand Up @@ -435,7 +435,7 @@ static unsigned const char shaders_glsl_logisticregression_comp_spv[] = {
0x06, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00,
0xfe, 0x00, 0x02, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x38, 0x00, 0x01, 0x00
};
static unsigned const int shaders_glsl_logisticregression_comp_spv_len = 4920;
}
}
#endif // define SHADEROP_SHADERLOGISTICREGRESSION_HPP
static const unsigned int shaders_glsl_logisticregression_comp_spv_len = 4920;
}
}
#endif // define SHADEROP_SHADERLOGISTICREGRESSION_HPP
60 changes: 30 additions & 30 deletions src/include/kompute/shaders/shaderopmult.hpp
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
/*
THIS FILE HAS BEEN AUTOMATICALLY GENERATED - DO NOT EDIT
---
Copyright 2020 The Institute for Ethical AI & Machine Learning
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

#ifndef SHADEROP_SHADEROPMULT_HPP
#define SHADEROP_SHADEROPMULT_HPP

namespace kp {
namespace shader_data {
static unsigned const char shaders_glsl_opmult_comp_spv[] = {
/*
THIS FILE HAS BEEN AUTOMATICALLY GENERATED - DO NOT EDIT
---
Copyright 2020 The Institute for Ethical AI & Machine Learning
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

#ifndef SHADEROP_SHADEROPMULT_HPP
#define SHADEROP_SHADEROPMULT_HPP

namespace kp {
namespace shader_data {
static const unsigned char shaders_glsl_opmult_comp_spv[] = {
0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x08, 0x00,
0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00,
0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00,
Expand Down Expand Up @@ -147,7 +147,7 @@ static unsigned const char shaders_glsl_opmult_comp_spv[] = {
0x17, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x28, 0x00, 0x00, 0x00,
0x27, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00
};
static unsigned const int shaders_glsl_opmult_comp_spv_len = 1464;
}
}
#endif // define SHADEROP_SHADEROPMULT_HPP
static const unsigned int shaders_glsl_opmult_comp_spv_len = 1464;
}
}
#endif // define SHADEROP_SHADEROPMULT_HPP
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
/*
THIS FILE HAS BEEN AUTOMATICALLY GENERATED - DO NOT EDIT
---
Copyright 2020 The Institute for Ethical AI & Machine Learning
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

#ifndef SHADEROP_SHADERTEST_LOGISTIC_REGRESSION_HPP
#define SHADEROP_SHADERTEST_LOGISTIC_REGRESSION_HPP

namespace kp {
namespace shader_data {
static unsigned const char test_shaders_glsl_test_logistic_regression_comp_spv[] = {
/*
THIS FILE HAS BEEN AUTOMATICALLY GENERATED - DO NOT EDIT
---
Copyright 2020 The Institute for Ethical AI & Machine Learning
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

#ifndef SHADEROP_SHADERTEST_LOGISTIC_REGRESSION_HPP
#define SHADEROP_SHADERTEST_LOGISTIC_REGRESSION_HPP

namespace kp {
namespace shader_data {
static const unsigned char test_shaders_glsl_test_logistic_regression_comp_spv[] = {
0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x08, 0x00,
0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00,
0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00,
Expand Down Expand Up @@ -435,7 +435,7 @@ static unsigned const char test_shaders_glsl_test_logistic_regression_comp_spv[]
0x06, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00,
0xfe, 0x00, 0x02, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x38, 0x00, 0x01, 0x00
};
static unsigned const int test_shaders_glsl_test_logistic_regression_comp_spv_len = 4920;
}
}
#endif // define SHADEROP_SHADERTEST_LOGISTIC_REGRESSION_HPP
static const unsigned int test_shaders_glsl_test_logistic_regression_comp_spv_len = 4920;
}
}
#endif // define SHADEROP_SHADERTEST_LOGISTIC_REGRESSION_HPP
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
/*
THIS FILE HAS BEEN AUTOMATICALLY GENERATED - DO NOT EDIT
---
Copyright 2020 The Institute for Ethical AI & Machine Learning
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

#ifndef SHADEROP_SHADERTEST_OP_CUSTOM_SHADER_HPP
#define SHADEROP_SHADERTEST_OP_CUSTOM_SHADER_HPP

namespace kp {
namespace shader_data {
static unsigned const char test_shaders_glsl_test_op_custom_shader_comp_spv[] = {
/*
THIS FILE HAS BEEN AUTOMATICALLY GENERATED - DO NOT EDIT
---
Copyright 2020 The Institute for Ethical AI & Machine Learning
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

#ifndef SHADEROP_SHADERTEST_OP_CUSTOM_SHADER_HPP
#define SHADEROP_SHADERTEST_OP_CUSTOM_SHADER_HPP

namespace kp {
namespace shader_data {
static const unsigned char test_shaders_glsl_test_op_custom_shader_comp_spv[] = {
0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x08, 0x00,
0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00,
0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00,
Expand Down Expand Up @@ -117,7 +117,7 @@ static unsigned const char test_shaders_glsl_test_op_custom_shader_comp_spv[] =
0x24, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00,
0x38, 0x00, 0x01, 0x00
};
static unsigned const int test_shaders_glsl_test_op_custom_shader_comp_spv_len = 1096;
}
}
#endif // define SHADEROP_SHADERTEST_OP_CUSTOM_SHADER_HPP
static const unsigned int test_shaders_glsl_test_op_custom_shader_comp_spv_len = 1096;
}
}
#endif // define SHADEROP_SHADERTEST_OP_CUSTOM_SHADER_HPP

0 comments on commit 562c6e8

Please sign in to comment.