Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add optional ComputeCpp version to benchmark attrs
Different versions of ComputeCpp can provide performance gains and are closely tied to the version of compute++ used, in turn providing further performance improvements. The inclusion of the version is optional to avoid a hard dependency on ComputeCpp.
- Loading branch information
1 parent
e3a19a5
commit c568192
Showing
9 changed files
with
140 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#include <benchmark/benchmark.h> | ||
#include "computecpp_version_config.h" | ||
#include "git_config.h" | ||
|
||
BENCHMARK_MAIN(); |
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,28 @@ | ||
/* | ||
* Copyright 2019 Codeplay Software Ltd. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use these files 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 COMPUTECPP_VERSION_CONFIG_H_ | ||
#define COMPUTECPP_VERSION_CONFIG_H_ | ||
|
||
extern bool const computecpp_available = @ComputeCpp_INFO_AVAILABLE@; | ||
|
||
extern char const* const computecpp_version = "@ComputeCpp_VERSION_NUMBER@"; | ||
extern char const* const computecpp_edition = "@ComputeCpp_EDITION@"; | ||
|
||
extern char const* const clang_git_hash = "@ComputeCpp_CLANG_BUILD@"; | ||
extern char const* const llvm_git_hash = "@ComputeCpp_LLVM_BUILD@"; | ||
|
||
#endif // COMPUTECPP_VERSION_CONFIG_H_ |
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,59 @@ | ||
/* | ||
* Copyright 2019 Codeplay Software Ltd. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use these files 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 SYCLDNN_BENCH_FIXTURE_ADD_COMPUTECPP_INFO_H_ | ||
#define SYCLDNN_BENCH_FIXTURE_ADD_COMPUTECPP_INFO_H_ | ||
|
||
#include <CL/sycl.hpp> | ||
|
||
#include "string_reporter.h" | ||
|
||
extern bool const computecpp_available; | ||
|
||
extern char const* const computecpp_version; | ||
extern char const* const computecpp_edition; | ||
|
||
extern char const* const clang_git_hash; | ||
extern char const* const llvm_git_hash; | ||
|
||
namespace sycldnn { | ||
namespace bench { | ||
namespace computecpp_info { | ||
|
||
/** | ||
* Add ComputeCpp meta-data (if available) to the benchmark label. The | ||
* version of compute++ is tied to the version of ComputeCpp, so the associated | ||
* meta-data of compute++ will be the same. | ||
* | ||
* SYCL-DNN benchmarks will include these attributes only if ComputeCpp info is | ||
* available. Benchmarks from other libraries such as MKL-DNN will never include | ||
* them. | ||
* | ||
* \param [out] reporter The benchmark string reporter to add the info to. | ||
*/ | ||
inline void add_computecpp_version(StringReporter& reporter) { | ||
if (computecpp_available) { | ||
reporter.add_to_label("@computecpp-version", computecpp_version); | ||
reporter.add_to_label("@computecpp-edition", computecpp_edition); | ||
reporter.add_to_label("@clang", clang_git_hash); | ||
reporter.add_to_label("@llvm", llvm_git_hash); | ||
} | ||
} | ||
|
||
} // namespace computecpp_info | ||
} // namespace bench | ||
} // namespace sycldnn | ||
|
||
#endif // SYCLDNN_BENCH_FIXTURE_ADD_COMPUTECPP_INFO_H_ |
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