DiCE API nvidia_logo_transpbg.gif Up
mi::neuraylib::IDice_configuration Class Referenceabstract

This interface allows configuration of DiCE. More...

#include <dice.h>

Inheritance diagram for mi::neuraylib::IDice_configuration:

Public Member Functions

virtual bool register_serializable_class (base::Uuid class_id, IUser_class_factory *factory)=0
 Registers a serializable class with DiCE. More...
 
template<class T>
bool register_serializable_class ()
 Registers a serializable class with DiCE. More...
 
virtual bool unregister_serializable_class (base::Uuid class_id)=0
 Unregisters a serializable class with DiCE. More...
 
template<class T>
bool unregister_serializable_class ()
 Unregisters a serializable class with DiCE. More...
 
virtual Sint32 set_gpu_enabled (bool value)=0
 Enables or disables GPU detection. More...
 
virtual bool get_gpu_enabled () const =0
 Returns if GPU detection is enabled. More...
 
virtual IRDMA_contextget_rdma_context (Uint32 host_id)=0
 Returns the RDMA context to be used for generating RDMA buffers. More...
 
virtual Uint32 get_highest_gpu_id (Uint32 host_id=0)=0
 Returns the highest GPU ID. More...
 
virtual const IGpu_descriptionget_gpu_description (Uint32 gpu_id, Uint32 host_id=0)=0
 Returns the description of a GPU with a given ID. More...
 
- Public Member Functions inherited from mi::base::IInterface
virtual Uint32 retain () const =0
 Increments the reference count. More...
 
virtual Uint32 release () const =0
 Decrements the reference count. More...
 
virtual const IInterfaceget_interface (const Uuid &interface_id) const =0
 Acquires a const interface from another. More...
 
template<class T>
const T * get_interface () const
 Acquires a const interface from another. More...
 
virtual IInterfaceget_interface (const Uuid &interface_id)=0
 Acquires a mutable interface from another. More...
 
template<class T>
T * get_interface ()
 Acquires a mutable interface from another. More...
 
virtual Uuid get_iid () const =0
 Returns the interface ID of the most derived interface. More...
 

Additional Inherited Members

- Public Types inherited from mi::base::Interface_declare< 0xfccbf7b8, ... >
typedef Interface_declare< id1, ... > Self
 Own type. More...
 
typedef Uuid_t< id1, ... > IID
 Declares the interface ID (IID) of this interface. More...
 
- Public Types inherited from mi::base::IInterface
typedef Uuid_t<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0> IID
 Declares the interface ID (IID) of this interface. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0xfccbf7b8, ... >
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 
- Static Public Member Functions inherited from mi::base::IInterface
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface. More...
 

Detailed Description

This interface allows configuration of DiCE.

For instance, the user-define database elements and jobs can be registered for serialization so that hosts in the cluster can set up the distributed database.

Member Function Documentation

 get_gpu_description()

virtual const IGpu_description * mi::neuraylib::IDice_configuration::get_gpu_description ( Uint32  gpu_id,
Uint32  host_id = 0 
)
pure virtual

Returns the description of a GPU with a given ID.

See also
get_highest_gpu_id()
Parameters
gpu_idThe GPU ID. Note that the lowest GPU ID is 1, not 0. The highest ID can be obtained from get_highest_gpu_id(). Note that GPU IDs do not need to be consecutive.
host_idAn optional host ID. If larger than 0, the returned GPU description refers to a GPU installed on the machine with the given host ID, and to the local host otherwise. See mi::neuraylib::INetwork_configuration::register_host_callback() for details about host IDs of other machines in the cluster.
Returns
A description of the GPU with that ID, or NULL if gpu_id is not a valid GPU ID for the host host_id.

 get_gpu_enabled()

virtual bool mi::neuraylib::IDice_configuration::get_gpu_enabled ( ) const
pure virtual

Returns if GPU detection is enabled.

Returns
The currently configured setting.

 get_highest_gpu_id()

virtual Uint32 mi::neuraylib::IDice_configuration::get_highest_gpu_id ( Uint32  host_id = 0)
pure virtual

Returns the highest GPU ID.

See also
get_gpu_description()
Parameters
host_idAn optional host ID. If larger than 0, the returned GPU description refers to a GPU installed on the machine with the given host ID, and to the local host otherwise.
Returns
The highest GPU ID installed on the specified host.

 get_rdma_context()

virtual IRDMA_context * mi::neuraylib::IDice_configuration::get_rdma_context ( Uint32  host_id)
pure virtual

Returns the RDMA context to be used for generating RDMA buffers.

Parameters
host_idThe id of the host for which to acquire the context
Returns
The RDMA context

 register_serializable_class() [1/2]

template<class T>
bool mi::neuraylib::IDice_configuration::register_serializable_class ( )
inline

Registers a serializable class with DiCE.

Registering a class for serialization allows communicating class instances through the serialization mechanism. It enables, for instance, storing database elements and jobs in the distributed database or communicating job results (see mi::neuraylib::IFragmented_job::execute_fragment_remote()).

Registering a class for serialization can only be done before DiCE has been started.

This templated member function is a wrapper of the non-template variant for the user's convenience. It uses the default class factory mi::neuraylib::User_class_factory specialized for T.

Returns
true if the class of type T was successfully registered for serialization, and false otherwise.

 register_serializable_class() [2/2]

virtual bool mi::neuraylib::IDice_configuration::register_serializable_class ( base::Uuid  class_id,
IUser_class_factory factory 
)
pure virtual

Registers a serializable class with DiCE.

Registering a class for serialization allows communicating class instances through the serialization mechanism. It enables, for instance, storing database elements and jobs in the distributed database or communicating job results (see mi::neuraylib::IFragmented_job::execute_fragment_remote()).

Registering a class for serialization can only be done before DiCE has been started.

Parameters
class_idThe class ID of the class that shall be registered for serialization.
factoryThe class factory.
Returns
true if the class of was successfully registered for serialization, and false otherwise.

 set_gpu_enabled()

virtual Sint32 mi::neuraylib::IDice_configuration::set_gpu_enabled ( bool  value)
pure virtual

Enables or disables GPU detection.

By default, GPU detection is enabled. GPU detection can be disabled in case it causes problems (hangs, crashes) or GPU usage is not desired at all.

This can only be configured before DiCE has been started.

Parameters
valuetrue if GPUs are to be detected, false otherwise.
Returns
0, in case of success, -1 in case of failure.

 unregister_serializable_class() [1/2]

template<class T>
bool mi::neuraylib::IDice_configuration::unregister_serializable_class ( )
inline

Unregisters a serializable class with DiCE.

Unregistering a class for serialization can only be done after DiCE has been shut down.

This templated member function is a wrapper of the non-template variant for the user's convenience.

Returns
true if the class of type T was successfully unregistered for serialization, and false otherwise.

 unregister_serializable_class() [2/2]

virtual bool mi::neuraylib::IDice_configuration::unregister_serializable_class ( base::Uuid  class_id)
pure virtual

Unregisters a serializable class with DiCE.

Unregistering a class for serialization can only be done after DiCE has been shut down.

Parameters
class_idThe class ID of the class that shall be unregistered for serialization.
Returns
true if the class of was successfully unregistered for serialization, and false otherwise.