diff --git a/hipfile/docs/core.rst b/hipfile/docs/core.rst index 7a3300bd..c1ff2b0d 100644 --- a/hipfile/docs/core.rst +++ b/hipfile/docs/core.rst @@ -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 * + 10 * `` +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. diff --git a/hipfile/include/hipfile.h b/hipfile/include/hipfile.h index 13a4c6bb..c2e58218 100644 --- a/hipfile/include/hipfile.h +++ b/hipfile/include/hipfile.h @@ -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 * + 10 * ` - * - * @return hipFileSuccess - * @return hipFileDriverVersionReadError - * @return hipFileInvalidValue - */ -HIPFILE_API -hipFileError_t hipFileGetBackendVersion(int *version); - // *********************************************************************** // PROPERTIES API // *********************************************************************** diff --git a/hipfile/src/amd_detail/hipfile.cpp b/hipfile/src/amd_detail/hipfile.cpp index ef50f3c2..f7970a62 100644 --- a/hipfile/src/amd_detail/hipfile.cpp +++ b/hipfile/src/amd_detail/hipfile.cpp @@ -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((major * 1000) + (minor * 10)); - - return {hipFileSuccess, hipSuccess}; -} -catch (...) { - return {hipFileInternalError, hipSuccess}; -} - hipFileError_t hipFileGetParameterSizeT(hipFileSizeTConfigParameter_t param, size_t *value) try { diff --git a/hipfile/src/nvidia_detail/hipfile.cpp b/hipfile/src/nvidia_detail/hipfile.cpp index 60092bf0..7e23022c 100644 --- a/hipfile/src/nvidia_detail/hipfile.cpp +++ b/hipfile/src/nvidia_detail/hipfile.cpp @@ -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 { diff --git a/hipfile/test/system/driver.cpp b/hipfile/test/system/driver.cpp index cfd0d91d..54a91604 100644 --- a/hipfile/test/system/driver.cpp +++ b/hipfile/test/system/driver.cpp @@ -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) diff --git a/hipfile/test/system/version.cpp b/hipfile/test/system/version.cpp index dc4d1f74..39bb3a9e 100644 --- a/hipfile/test/system/version.cpp +++ b/hipfile/test/system/version.cpp @@ -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 diff --git a/hipfile/test/test-hipfile.cpp b/hipfile/test/test-hipfile.cpp index 114d9ba8..6f5d8b8b 100644 --- a/hipfile/test/test-hipfile.cpp +++ b/hipfile/test/test-hipfile.cpp @@ -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); @@ -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. */ diff --git a/rocfile/docs/core.rst b/rocfile/docs/core.rst index de672fb6..d5ae3fbf 100644 --- a/rocfile/docs/core.rst +++ b/rocfile/docs/core.rst @@ -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 -----------------------------