Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ list(APPEND VIEW_FILES
src/view/src/compute/rocprofvis_compute_workload_view.cpp
src/view/src/compute/rocprofvis_compute_kernel_metric_table.cpp
src/view/src/compute/rocprofvis_compute_comparison.cpp
src/view/src/compute/rocprofvis_compute_code_view.cpp
src/view/src/compute/rocprofvis_compute_tester.cpp
src/view/src/model/compute/rocprofvis_compute_data_model.cpp
src/view/src/widgets/rocprofvis_compute_widget.cpp
Expand Down
1 change: 1 addition & 0 deletions src/controller/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ list(APPEND rocprofvis_controller_source_files
src/compute/rocprofvis_controller_trace_compute.cpp
src/compute/rocprofvis_controller_workload.cpp
src/compute/rocprofvis_controller_kernel.cpp
src/compute/rocprofvis_controller_pc_sampling.cpp
src/compute/rocprofvis_controller_metrics_container.cpp
src/compute/rocprofvis_controller_roofline.cpp
src/compute/rocprofvis_controller_table_compute_pivot.cpp
Expand Down
10 changes: 10 additions & 0 deletions src/controller/inc/rocprofvis_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,16 @@ void rocprofvis_controller_metrics_container_free(rocprofvis_controller_metrics_
* @returns kRocProfVisResultSuccess or an error code.
*/
rocprofvis_result_t rocprofvis_controller_metric_fetch_async(rocprofvis_controller_t* controller, rocprofvis_controller_arguments_t* args, rocprofvis_controller_future_t* result, rocprofvis_controller_metrics_container_t* output);

/*
* Fetch PC sampling data for a specific kernel and source file asynchronously.
* @param controller The controller
* @param args Input arguments (workload id, kernel id, source file id)
* @param result The future to wait on
* @param output The PC sampling handle to write to
* @returns kRocProfVisResultSuccess or an error code.
*/
rocprofvis_result_t rocprofvis_controller_pc_sampling_fetch_async(rocprofvis_controller_t* controller, rocprofvis_controller_arguments_t* args, rocprofvis_controller_future_t* result, rocprofvis_handle_t* output);
#endif

/*
Expand Down
61 changes: 61 additions & 0 deletions src/controller/inc/rocprofvis_controller_enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ typedef enum rocprofvis_controller_object_type_t
kRPVControllerObjectTypeMetricsContainer = 103,
// Roofline object
kRPVControllerObjectTypeRoofline = 104,
//PcSampling
kRPVControllerObjectTypePCSampling = 105,
#endif

} rocprofvis_controller_object_type_t;
Expand Down Expand Up @@ -898,9 +900,58 @@ typedef enum rocprofvis_controller_kernel_properties_t : uint32_t
kRPVControllerKernelDurationMax,
kRPVControllerKernelDurationMedian,
kRPVControllerKernelDurationMean,
kRPVControllerKernelPcSampling,
__kRPVControllerKernelPropertiesLast
} rocprofvis_controller_kernel_properties_t;

/*
* Pc Sampling data for kernels
*/
typedef enum rocprofvis_controller_pc_sampling_data_properties_t : uint32_t
{
__kRPVControllerPCSamplingPropertiesFirst,
kRPVControllerPCSamplingNumSourceFiles = __kRPVControllerPCSamplingPropertiesFirst,
kRPVControllerPCSamplingSourceFileId,
kRPVControllerPCSamplingFilePath,
kRPVControllerPCSamplingSourceFileChecksum,
kRPVControllerPCSamplingNumSourceLines,
kRPVControllerPCSamplingSourceLineId,
kRPVControllerPCSamplingSourceLineSourceFileId,
kRPVControllerPCSamplingSourceLineNumber,
kRPVControllerPCSamplingSourceLineContent,
kRPVControllerPCSamplingNumCodeObjects,
kRPVControllerPCSamplingCodeObjectId,
kRPVControllerPCSamplingCodeObjectUri,
kRPVControllerPCSamplingCodeObjectChecksum,
kRPVControllerPCSamplingNumIsaLines,
kRPVControllerPCSamplingIsaLineId,
kRPVControllerPCSamplingIsaLineCodeObjectId,
kRPVControllerPCSamplingIsaLineCodeObjectOffset,
kRPVControllerPCSamplingIsaLineInstructionTypeId,
kRPVControllerPCSamplingIsaLineInstruction,
kRPVControllerPCSamplingIsaLineComment,
kRPVControllerPCSamplingNumIsaToIsaDeps,
kRPVControllerPCSamplingIsaToIsaDependentIsaLineId,
kRPVControllerPCSamplingIsaToIsaDependencyIsaLineId,
kRPVControllerPCSamplingNumIsaToSourceDeps,
kRPVControllerPCSamplingIsaToSourceIsaLineId,
kRPVControllerPCSamplingIsaToSourceSourceLineId,
kRPVControllerPCSamplingIsaToSourceDepth,
kRPVControllerPCSamplingNumStallRecords,
kRPVControllerPCSamplingStallRecordId,
kRPVControllerPCSamplingStallRecordIsaLineId,
kRPVControllerPCSamplingStallRecordDispatchId,
kRPVControllerPCSamplingStallRecordAvgActiveLanes,
kRPVControllerPCSamplingStallRecordWaveIssuedCount,
kRPVControllerPCSamplingStallRecordTotalSampleCount,
kRPVControllerPCSamplingNumStallReasonCounts,
kRPVControllerPCSamplingStallReasonRecordId,
kRPVControllerPCSamplingStallReasonTypeId,
kRPVControllerPCSamplingStallReasonCount,
__kRPVControllerPCSamplingPropertiesLast

} rocprofvis_controller_pc_sampling_data_properties_t;

/*
* Arguments for fetching metric values.
*/
Expand All @@ -915,6 +966,16 @@ typedef enum rocprofvis_controller_metric_arguments_t : uint32_t
kRPVControllerMetricArgsMetricEntryIdIndexed,
} rocprofvis_controller_metric_arguments_t;

/*
* Arguments for fetching PC sampling data for a specific source file.
*/
typedef enum rocprofvis_controller_pc_sampling_arguments_t : uint32_t
{
kRPVControllerPcSamplingArgsWorkloadId,
kRPVControllerPcSamplingArgsKernelId,
kRPVControllerPcSamplingArgsSourceFileId,
} rocprofvis_controller_pc_sampling_arguments_t;

/*
* Arguments for fetching dynamic metrics matrix (pivot table).
*/
Expand Down
19 changes: 19 additions & 0 deletions src/controller/src/compute/rocprofvis_controller_kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,25 @@ rocprofvis_result_t Kernel::GetUInt64(rocprofvis_property_t property, uint64_t i
return result;
}

rocprofvis_result_t Kernel::GetObject(rocprofvis_property_t property, uint64_t index, rocprofvis_handle_t** value)
{
(void)index;
rocprofvis_result_t result = kRocProfVisResultInvalidArgument;
if(value)
{
if(property == kRPVControllerKernelPcSampling)
{
*value = (rocprofvis_handle_t*)&m_pc_sampling_data;
result = kRocProfVisResultSuccess;
}
else
{
result = UnhandledProperty(property);
}
}
return result;
}

rocprofvis_result_t Kernel::GetString(rocprofvis_property_t property, uint64_t index, char* value, uint32_t* length)
{
(void)index;
Expand Down
3 changes: 3 additions & 0 deletions src/controller/src/compute/rocprofvis_controller_kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include "rocprofvis_controller_handle.h"
#include "rocprofvis_c_interface_types.h"
#include "rocprofvis_controller_pc_sampling.h"
#include <string>

namespace RocProfVis
Expand All @@ -23,6 +24,7 @@ class Kernel : public Handle

rocprofvis_result_t GetUInt64(rocprofvis_property_t property, uint64_t index, uint64_t* value) final;
rocprofvis_result_t GetString(rocprofvis_property_t property, uint64_t index, char* value, uint32_t* length) final;
rocprofvis_result_t GetObject(rocprofvis_property_t property, uint64_t index, rocprofvis_handle_t** value) final;

rocprofvis_result_t SetUInt64(rocprofvis_property_t property, uint64_t index, uint64_t value) final;
rocprofvis_result_t SetString(rocprofvis_property_t property, uint64_t index, char const* value) final;
Expand All @@ -38,6 +40,7 @@ class Kernel : public Handle
uint32_t m_duration_max;
uint32_t m_duration_median;
uint32_t m_duration_mean;
PcSampling m_pc_sampling_data;
};

}
Expand Down
Loading
Loading