blender/intern/cycles/device/hiprt/queue.h
Brecht Van Lommel 5c328388f3 Cycles: Add concurrent states growth and shrinking for all GPU backends
This helps avoid out of memory errors for complex scenes, and improves
performance for smaller scenes with more memory available for states.

Metal already had logic like this, now the logic is centralized and can
be used for all GPU backends.

The parameters have been somewhat tuned per device, based on earlier
work for oneAPI in #163437 and CUDA in #163532. For Metal the behavior
should remain basically the same.

For oneAPI, this enables free_memory queries on iGPUs, as driver have
been exposing this for some time.

Co-authored-by: Patrick Mours <pmours@nvidia.com>
Co-authored-by; Xavier Hallade <xavier.hallade@intel.com>

Pull Request: https://projects.blender.org/blender/blender/pulls/163930
2026-09-23 15:22:57 +02:00

34 lines
700 B
C++

/* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
*
* SPDX-License-Identifier: Apache-2.0 */
#pragma once
#ifdef WITH_HIPRT
# include "device/memory.h"
# include "device/queue.h"
# include "device/hip/queue.h"
CCL_NAMESPACE_BEGIN
class HIPRTDevice;
class HIPRTDeviceQueue : public HIPDeviceQueue {
public:
HIPRTDeviceQueue(HIPRTDevice *device);
~HIPRTDeviceQueue() override = default;
int num_concurrent_states(const size_t state_size) const override;
bool enqueue(DeviceKernel kernel,
const int work_size,
const DeviceKernelArguments &args) override;
protected:
HIPRTDevice *hiprt_device_;
};
CCL_NAMESPACE_END
#endif /* WITH_HIPRT */