Skip to content
Merged
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
18 changes: 6 additions & 12 deletions hipfile/docs/core.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,13 @@ to integer values and will never contain text strings like "-patch1".
hipFile also includes an API call for determining the library version at
runtime:

This API call can be used to get the individual components of the version
number.

``hipFileError_t hipFileGetVersion(unsigned *major, unsigned *minor, unsigned *patch)``

Any of the parameters can be ignored by passing in a NULL pointer.


The Version of the Back-end Library
-----------------------------------
hipFile also includes an API call for determining the back-end library version
(e.g., cuFile, rocFile) at runtime:

``hipFileError_t hipFileGetBackendVersion(int *version)``

The version number reported will depend on the underlying library. Currently,
both cuFile and rocFile use the following formula:

``1000 * <major version> + 10 * <minor version>``
We do not provide a hipFile equivalent to cuFile's ``cuFileGetVersion()``
via the ``hipify`` tool. This is because any logic involving the obtained
version number would be platform-specific and have to be customized regardless.
17 changes: 0 additions & 17 deletions hipfile/include/hipfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -939,23 +939,6 @@ hipFileError_t hipFileStreamDeregister(hipStream_t stream);
HIPFILE_API
hipFileError_t hipFileGetVersion(unsigned *major, unsigned *minor, unsigned *patch);

/*!
* @brief Get the version of the underlying library used by hipFile
* @ingroup core
*
* @param [out] version The version of the underlying library
*
* @note Both cuFile and rocFile are represented by the following
* equation:
* `1000 * <MAJOR VERSION> + 10 * <MINOR VERSION>`
*
* @return hipFileSuccess
* @return hipFileDriverVersionReadError
* @return hipFileInvalidValue
*/
HIPFILE_API
hipFileError_t hipFileGetBackendVersion(int *version);

// ***********************************************************************
// PROPERTIES API
// ***********************************************************************
Expand Down
24 changes: 0 additions & 24 deletions hipfile/src/amd_detail/hipfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,30 +305,6 @@ catch (...) {
return {hipFileInternalError, hipSuccess};
}

hipFileError_t
hipFileGetBackendVersion(int *version)
try {
unsigned major = UINT_MAX;
unsigned minor = UINT_MAX;

if (version == nullptr) {
return {hipFileInvalidValue, hipSuccess};
}

auto result = rocFileGetVersion(&major, &minor, nullptr);
if (result.err != rocFileSuccess) {
return toHipFileError(result);
}

// This is the same algorithm as NVIDIA's
*version = static_cast<int>((major * 1000) + (minor * 10));

return {hipFileSuccess, hipSuccess};
}
catch (...) {
return {hipFileInternalError, hipSuccess};
}

hipFileError_t
hipFileGetParameterSizeT(hipFileSizeTConfigParameter_t param, size_t *value)
try {
Expand Down
9 changes: 0 additions & 9 deletions hipfile/src/nvidia_detail/hipfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,15 +309,6 @@ catch (...) {
return {hipFileInternalError, hipSuccess};
}

hipFileError_t
hipFileGetBackendVersion(int *version)
try {
return toHipFileError(cuFileGetVersion(version));
}
catch (...) {
return {hipFileInternalError, hipSuccess};
}

hipFileError_t
hipFileGetParameterSizeT(hipFileSizeTConfigParameter_t param, size_t *value)
try {
Expand Down
3 changes: 0 additions & 3 deletions hipfile/test/system/driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,6 @@ TEST_F(DriverNoInit, hipFileGetVersion)
unsigned minor = UINT_MAX;
unsigned patch = UINT_MAX;
ASSERT_EQ(hipFileGetVersion(&major, &minor, &patch), HIPFILE_SUCCESS);

int version = -1;
ASSERT_EQ(hipFileGetBackendVersion(&version), HIPFILE_SUCCESS);
}

TEST_F(DriverNoInit, hipFileGetParameterSizeT)
Expand Down
13 changes: 0 additions & 13 deletions hipfile/test/system/version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,6 @@ TEST(HipFileVersioning, Get)

// NULL pointers should NOT produce errors
ASSERT_EQ(hipFileGetVersion(nullptr, nullptr, nullptr), HIPFILE_SUCCESS);

// hipFileGetBackendVersion() succeeds and returns a value >= 0
//
// We can't reliably predict what the version number will be for
// an arbitrary library, but it probably won't be negative and
// checking for >= 0 ensures the -1 initialization value is
// overwritten.
int backend_version = -1;
ASSERT_EQ(hipFileGetBackendVersion(&backend_version), HIPFILE_SUCCESS);
ASSERT_GE(backend_version, 0);

// NULL pointer returns correct error
ASSERT_EQ(hipFileGetBackendVersion(nullptr), HipFileOpError(hipFileInvalidValue));
}

HIPFILE_WARN_NO_GLOBAL_CTOR_ON
14 changes: 0 additions & 14 deletions hipfile/test/test-hipfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ main(int argc, char *argv[])
uint64_t start_max_device_cache_size;
uint64_t start_max_device_pinned_mem_size;

// hipFile Version
int hipfile_version;

if (argc != 3) {
fprintf(stderr, "Usage: %s FILE_IN FILE_OUT\n", argv[0]);
exit(1);
Expand Down Expand Up @@ -243,17 +240,6 @@ main(int argc, char *argv[])
fprintf(stderr, " This is unusual, but not unexpected.\n");
}

// Testing library version
err = hipFileGetBackendVersion(&hipfile_version);
if (err.err != hipFileSuccess) {
fprintf(stderr, "hipFileGetBackendVersion failed.\n");
fprintf(stderr, "hipFileError: %d\n", err.err);
fprintf(stderr, "hipError: %d\n", err.hip_drv_err);
rc = 1;
goto deregister_dbuf;
}
fprintf(stderr, "hipFileVersion: %d\n", hipfile_version);

/**
* Test cleanup.
*/
Expand Down
7 changes: 4 additions & 3 deletions rocfile/docs/core.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ to integer values and will never contain text strings like "-patch1".
rocFile also includes an API call for determining the library version at
runtime:

``rocFileError_t rocFileGetVersion(int *version)``
This API call can be used to get the individual components of the version
number.

The returned version number uses the same formula as cuFile:
``rocFileError_t rocFileGetVersion(unsigned *major, unsigned *minor, unsigned *patch)``

``1000 * ROCFILE_MAJOR_VERSION + 10 * ROCFILE_MINOR_VERSION``
Any of the parameters can be ignored by passing in a NULL pointer.

Parameter Getters and Setters
-----------------------------
Expand Down