omni/experimental/job/IJob.h
File members: omni/experimental/job/IJob.h
// Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
#pragma once
#include "../../../carb/Interface.h"
#include "../../core/IObject.h"
#include "../../../carb/IObject.h"
namespace omni
{
namespace experimental
{
namespace job
{
using JobFunction = void (*)(void* job_data);
OMNI_DECLARE_INTERFACE(IAffinityMask);
using MaskType = uint64_t;
class IAffinityMask_abi
: public omni::core::Inherits<omni::core::IObject, OMNI_TYPE_ID("omni.experimental.job.IAffinityMask")>
{
protected:
virtual MaskType get_affinity_mask_abi(size_t index) noexcept = 0;
virtual void set_affinity_mask_abi(size_t index, MaskType mask) noexcept = 0;
virtual size_t get_mask_count_abi() noexcept = 0;
virtual size_t get_default_mask_count_abi() noexcept = 0;
virtual void set_mask_count_abi(size_t count) noexcept = 0;
};
OMNI_DECLARE_INTERFACE(IJob);
OMNI_DECLARE_INTERFACE(IJobWorker);
OMNI_DECLARE_INTERFACE(IJobAffinity);
class IJob_abi : public omni::core::Inherits<omni::core::IObject, OMNI_TYPE_ID("omni.experimental.job.IJob")>
{
protected:
virtual void enqueue_job_abi(JobFunction job_fn, OMNI_ATTR("in, out") void* job_data) noexcept = 0;
};
class IJobWorker_abi : public omni::core::Inherits<omni::core::IObject, OMNI_TYPE_ID("omni.experimental.job.IJobWorker")>
{
protected:
virtual size_t get_default_worker_count_abi() noexcept = 0;
virtual size_t get_worker_count_abi() noexcept = 0;
virtual void set_worker_count_abi(size_t count) noexcept = 0;
};
class IJobAffinity_abi
: public omni::core::Inherits<omni::core::IObject, OMNI_TYPE_ID("omni.experimental.job.IJobAffinity")>
{
protected:
virtual IAffinityMask* get_affinity_abi(size_t worker_id) noexcept = 0;
virtual bool set_affinity_abi(size_t worker_id, OMNI_ATTR("not_null") IAffinityMask* mask) noexcept = 0;
};
} // namespace job
} // namespace experimental
} // namespace omni
#include "IJob.gen.h"