Skip to content

GpaCloseContext

Copyright (c) 2018-2024 Advanced Micro Devices, Inc. All rights reserved.

Syntax

GpaStatus GpaCloseContext(
GpaContextId context_id);

Description

Closes the specified context, which ends access to GPU performance counters. After closing a context, GPA functions should not be called again until the counters are reopened with GpaOpenContext.

Parameters

NameDescription
context_idUnique identifier of a previously-opened context.

Return value

Return valueDescription
kGpaStatusOkThe context was successfully closed.
kGpaStatusErrorGpaNotInitializedGPA was not initialized. Call GpaInitialize before all other entrypoints.
kGpaStatusErrorNullPointerThe supplied context_id parameter is NULL.
kGpaStatusErrorContextNotFoundThe supplied context_id parameter was not recognized as a previously-opened context identifier.
kGpaStatusErrorContextNotOpenThe supplied context is not currently open.
kGpaStatusErrorInvalidParameterThe API type of the supplied context does not match GPA’s API type.
kGpaStatusErrorFailedThe context could not be closed.
kGpaStatusErrorExceptionException occurred.