NVIDIA Holoscan SDK v3.0.0

Class GPUDevice

Base Type

class GPUDevice : public holoscan::gxf::GXFSystemResourceBase

GPU device resource.

This resource can be used to associate a set of components with a particular GPU device ID.

The Holoscan SDK components which will use a GPUDevice resource if found include:

dev0 = make_resource<GPUDevice>(“dev0”, Arg(“dev_id”, static_cast<int32_t>(0)));

gpu0_group = EntityGroup(“gpu0_group”); gpu0_group.add(*dev0);

Then any other components that need to be associated with this device can be added to that same entity group.

==Parameters==

  • dev_id (int32_t, optional): The CUDA device id specifying which device the memory pool will use (Default: 0).

Public Functions

template<typename ArgT, typename ...ArgsT, typename = std::enable_if_t<!std::is_base_of_v<::holoscan::Resource, std::decay_t<ArgT>> && (std::is_same_v<::holoscan::Arg, std::decay_t<ArgT>> || std::is_same_v<::holoscan::ArgList, std::decay_t<ArgT>>)>>
inline explicit GPUDevice(ArgT &&arg, ArgsT&&... args)
GPUDevice() = default
GPUDevice(const std::string &name, nvidia::gxf::GPUDevice *component)
inline virtual const char *gxf_typename() const override

The underlying GXF component’s name.

virtual void setup(ComponentSpec &spec) override

Define the resource specification.

Parameters

spec – The reference to the component specification.

int32_t device_id() const

The GPU device ID.

Previous Class FragmentScheduler
Next Template Class Graph
© Copyright 2022-2025, NVIDIA. Last updated on Mar 12, 2025.