Add license header to py_nvbench.cpp

Also updated comment as to why calling
`nvbench::benchmark_manager::get().initialize()` is necessary
for running all tests.
This commit is contained in:
Oleksandr Pavlyk
2025-07-01 09:19:18 -05:00
parent 6552ef503c
commit b88cc78aeb

View File

@@ -1,4 +1,20 @@
// TODO: Copyright header
/*
* Copyright 2025 NVIDIA Corporation
*
* Licensed under the Apache License, Version 2.0 with the LLVM exception
* (the "License"); you may not use this file except in compliance with
* the License.
*
* You may obtain a copy of the License at
*
* http://llvm.org/foundation/relicensing/LICENSE.txt
*
* 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.
*/
#include <nvbench/nvbench.cuh>
@@ -140,8 +156,8 @@ public:
try
{
// TODO: This line is mandatory for correctness
// Q: Why is initializing at module init not enough?
// This line is mandatory for correctness to populate
// benchmark with devices requested by user via CLI
nvbench::benchmark_manager::get().initialize();
{
nvbench::option_parser parser{};
@@ -184,6 +200,8 @@ PYBIND11_MODULE(_nvbench, m)
NVBENCH_DRIVER_API_CALL(cuInit(0));
// This line ensures that benchmark_manager has been created during module init
// It is reinitialized before running all benchmarks to set devices to use
nvbench::benchmark_manager::get().initialize();
// TODO: Use cuModuleGetLoadingMode(&mode) to confirm that (mode == CU_MODULE_EAGER_LOADING)