85006053ed
The rdc.h is the only header file will be provided to the user.
The inital version only includes the data structure and function
required for the job stats example.
The example folder has one example demonstrated how to use the API
to collect the job summary stats.
The RdcBootStrap.cc will dynamically load different libraries when user
select either the standalone or embbed mode. We also created a
dummy RdcEmbeddedHandler.cc for librdc.so.
In order to run the example after build, it needs to specify the
LD_LIBRARY_PATH. Assume current folder is the build folder:
LD_LIBRARY_PATH=$PWD/rdc_libs $PWD/example/jobstats
The folder is structured in following ways:
example
include
- rdc - rdc.h (the only header file exposed to the user)
- rdc_libs
- impl
rdc_libs
- boostrap
- src
- rdc
- src
- rdc_client
- src
- rdc_server
- src
Change-Id: Ia386ddf4cabcb2dc4fe82de6464ca0619cb3d959
63 рядки
2.3 KiB
C++
63 рядки
2.3 KiB
C++
/*
|
|
Copyright (c) 2020 - present Advanced Micro Devices, Inc. All rights reserved.
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
in the Software without restriction, including without limitation the rights
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
all copies or substantial portions of the Software.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
THE SOFTWARE.
|
|
*/
|
|
#ifndef RDC_LIB_IMPL_RDCEMBEDDEDHANDLER_H_
|
|
#define RDC_LIB_IMPL_RDCEMBEDDEDHANDLER_H_
|
|
|
|
#include "rdc_lib/RdcHandler.h"
|
|
|
|
|
|
namespace amd {
|
|
namespace rdc {
|
|
|
|
class RdcEmbeddedHandler: public RdcHandler
|
|
{
|
|
public:
|
|
rdc_status_t rdc_group_gpu_create(rdc_group_type_t type,
|
|
const char* group_name,
|
|
rdc_gpu_group_t* p_rdc_group_id) override;
|
|
rdc_status_t rdc_group_gpu_add(rdc_gpu_group_t groupId,
|
|
uint32_t gpu_index) override;
|
|
|
|
rdc_status_t rdc_job_start_stats(rdc_gpu_group_t groupId,
|
|
char job_id[64]) override;
|
|
|
|
rdc_status_t rdc_watch_job_fields(rdc_gpu_group_t groupId,
|
|
uint64_t update_freq, double max_keep_age,
|
|
uint32_t max_keep_samples) override;
|
|
rdc_status_t rdc_job_get_stats(char jobId[64],
|
|
rdc_job_info_t* p_job_info) override;
|
|
rdc_status_t rdc_job_stop_stats(char job_id[64]) override;
|
|
|
|
rdc_status_t rdc_update_all_fields(uint32_t wait_for_update) override;
|
|
|
|
explicit RdcEmbeddedHandler(rdc_operation_mode_t op_mode);
|
|
};
|
|
|
|
} // namespace rdc
|
|
} // namespace amd
|
|
|
|
extern "C" {
|
|
amd::rdc::RdcHandler *make_handler(rdc_operation_mode_t op_mode);
|
|
}
|
|
|
|
#endif // RDC_LIB_IMPL_RDCEMBEDDEDHANDLER_H_
|