Files
test2/intern/cycles/util/guiding.h
Brecht Van Lommel d0c2e68e5f Refactor: Cycles: Automated clang-tidy fixups in Cycles
* Use .empty() and .data()
* Use nullptr instead of 0
* No else after return
* Simple class member initialization
* Add override for virtual methods
* Include C++ instead of C headers
* Remove some unused includes
* Use default constructors
* Always use braces
* Consistent names in definition and declaration
* Change typedef to using

Pull Request: https://projects.blender.org/blender/blender/pulls/132361
2025-01-03 10:22:55 +01:00

41 lines
692 B
C

/* SPDX-FileCopyrightText: 2022 Blender Foundation
*
* SPDX-License-Identifier: Apache-2.0 */
#pragma once
#ifdef WITH_PATH_GUIDING
# include <openpgl/cpp/OpenPGL.h> // IWYU pragma: export
# include <openpgl/version.h> // IWYU pragma: export
#endif
#include "util/system.h" // IWYU pragma: keep
CCL_NAMESPACE_BEGIN
static int guiding_device_type()
{
#ifdef WITH_PATH_GUIDING
# if defined(__ARM_NEON)
return 8;
# else
if (system_cpu_support_avx2()) {
return 8;
}
if (system_cpu_support_sse42()) {
return 4;
}
return 0;
# endif
#else
return 0;
#endif
}
static inline bool guiding_supported()
{
return guiding_device_type() != 0;
}
CCL_NAMESPACE_END