Advertisement

Quick Links

Solid State Graphics (SSG)
API User Manual

Advertisement

Table of Contents
loading

Summary of Contents for Radeon Pro Solid State Graphics

  • Page 1 Solid State Graphics (SSG) API User Manual...
  • Page 2: Table Of Contents

    Contents Introduction ............................3 Requirements ............................3 OpenCL™ Extension Specification ......................3 clCreateSsgFileObjectAMD ......................3 clGetSsgFileObjectInfoAMD ......................4 clRetainSsgFileObjectAMD ......................4 clReleaseSsgFileObjectAMD ......................5 clEnqueueReadSsgFileAMD ......................5 clEnqueueWriteSsgFileAMD ......................7 OpenCL Performance Guidelines and Caveats ..................8 AMD Code Sample for OpenCL ......................10 OpenGL®...
  • Page 3: Introduction

    The Radeon™ Pro SSG software library enables peer-to-peer (P2P) data transfers between GPU and Radeon on board SSD devices. It allows a methodology to read OS file data from SSDs to OpenCL™, OpenGL® and DirectX® buffers with very low-latency P2P communication. The development kit version of this library supports only the Microsoft®...
  • Page 4: Clgetssgfileobjectinfoamd

    3.2 clGetSsgFileObjectInfoAMD The clGetSsgFileObjectInfoAMD function returns information about a file object. cl_int clGetSsgFileObjectInfoAMD(cl_file_amd file, cl_file_info_amd param_name, size_t param_value_size, void* param_value, size_t* param_value_size_ret) file [in] Specifies the file object of query. param_name [in] Specifies the information to query. The table below provides a list of supported param_name types and the information that clGetSsgFileObjectInfoAMD will return in param_value.
  • Page 5: Clreleasessgfileobjectamd

    CL_SUCCESS The function executed successfully. CL_INVALID_FILE_OBJECT_AMD The file is invalid for OpenCL. 3.4 clReleaseSsgFileObjectAMD The clReleaseSsgFileObjectAMD function decrements the file-object reference count. cl_int clReleaseSsgFileObjectAMD(cl_file_amd file) file [in] Specifies the file object to be released. Return Value Description CL_SUCCESS The function executed successfully. CL_INVALID_FILE_OBJECT_AMD The file is invalid for OpenCL.
  • Page 6 [in] buffer_offset Offset (in bytes) in the buffer object to which the function is writing. It must be a multiple of CL_FILE_BLOCK_SIZE_AMD. [in] size Size (in bytes) of data being read. It must be a multiple of CL_FILE_BLOCK_SIZE_AMD. If the file size isn’t a multiple of the block size, read the end of the file by aligning the read size with the next block multiple beyond the file size.
  • Page 7: Clenqueuewritessgfileamd

    CL_MEM_OBJECT_ALLOCATION_FAILURE Memory failed to allocate for data store associated with buffer. 3.6 clEnqueueWriteSsgFileAMD The clEnqueueWriteSsgFileAMD function writes directly from a CL memory object to a file object. cl_int clEnqueueWriteSsgFileAMD(cl_command_queue command_queue, cl_mem buffer, cl_bool blocking_write, size_t buffer_offset, size_t size, cl_file_amd file, size_t file_offset, cl_uint...
  • Page 8: Opencl Performance Guidelines And Caveats

    synchronization points, and the contexts associated with events in event_wait_list and command_queue must be the same. Memory associated with event_wait_list can be reused or freed-up after the function returns. [out, optional] event Returns an event object that identifies the clEnqueueWriteSsgFileAMD command and can query or queue a wait for this command to finish executing.
  • Page 9 copy the internal device memory to the destination buffer. Internal device copies will execute at full memory-controller speed, which varies from 100 GB/s to 500 GB/s depending on the GPU type. • The copy size, buffer offset and file offset must adhere to the SSD’s alignment restrictions. Discover these restrictions by calling clGetSsgFileObjectInfoAMD.
  • Page 10: Amd Code Sample For Opencl

    5 AMD Code Sample for OpenCL // Create file. cl_int clStatus = CL_SUCCESS; cl_file_amd clSsgFile = clCreateSsgFileObjectAMD(m_clContext, CL_FILE_READ_ONLY_AMD, FILE_NAME, &clStatus); if (clStatus != CL_SUCCESS) { std::cout << "Error: Unable to create file handle." << std::endl; return; // Get the file-size information. size_t retSize = 0;...
  • Page 11: Opengl® Extension Specification

    6 OpenGL® Extension Specification This OpenGL extension accelerates the data transfer between GPU and SSD devices. It introduces a new file object that operates on the file in an SSD. The result of a file operation (read or write) can be any named buffer object.
  • Page 12: Glreadfileamd

    GLvoid glGetFileParameteri64vAMD(GLfilehandleAMD file, GLenum pname, GLuint64* params); file [in] The GL file for which properties are required. pname [in] The property information being requested. It must be GL_FILE_BLOCK_SIZE_AMD or GL_FILE_SIZE_AMD. params [out] The value of the property requested. Error Description INVALID_VALUE The file object is invalid.
  • Page 13: Glwritefileamd

    size [in] The amount of information (in bytes) being read. It must be a multiple of GL_FILE_BLOCK_SIZE_AMD. If the file size is not a multiple of the block size, read the end of the file by aligning the read size with the next block multiple beyond the file size.
  • Page 14: Opengl Performance Guidelines And Caveats

    fileOffset [in] File location to which data (of width size, in bytes) will be written. It must be a multiple of GL_FILE_BLOCK_SIZE_AMD. size [in] Amount of information (in bytes) being written. It must be a multiple of GL_FILE_BLOCK_SIZE_AMD. If the file size is not a multiple of the block size, read the end of the file by aligning the read size with the next block multiple beyond the file size.
  • Page 15 • The glNamedBufferStorage() API can also allocate local invisible memory; just set the GL_MAP_READ_BIT or GL_MAP_WRITE_BIT flag without setting GL_MAP_PERSISTENT_BIT. • OpenGL also provides other ways to allocate local invisible memory: glBufferData and glBufferSubData. Only when the buffer is created in local visible video memory (using glNamedBufferStorage with •...
  • Page 16: Amd Code Sample For Opengl

    8 AMD Code Sample for OpenGL // Create file: FILE_NAME is the file path. GLfilehandleAMD hSsgFileFile = glCreateFileAMD(FILE_NAME, GL_READ_ONLY); (hSsgFileFile != NULL) std::cout << "Error: Unable to open the file." << std::endl; return; // Get the file-size information. GLuint64 fileSize = 0; glGetFileParameteri64vAMD(hSsgFileFile, GL_FILE_SIZE_AMD, &fileSize);...
  • Page 17: Directx® 11 Extension Specification

    9 DirectX™ 11 Extension Specification The DirectX 11 extension accelerates the data transfer between GPU and SSD devices. It introduces a new interface that operates on the file in an SSD. The result of the operation (read or write) can be any named buffer object.
  • Page 18: Getextensionversion

    9.1 GetExtensionVersion The GetExtensionVersion function returns the SSG extension version information. HRESULT GetExtensionVersion(AmdDxExtVersion* pExtVersion); pExtVersion [in] Address pointer to the returned version information. Remarks The extVersionMajor/Minor values will increase as the extension interface expands to add new functions. The liquidFlashBuild number indicates the functional improvement in the Liquid Flash library. This value is also necessary to determine the library version when a customer reports a problem.
  • Page 19: Getfileinfo

    HRESULT ReleaseFile(AmdDxLfFileHandle hFile); hFile [in] Handle for the SSG file to close. Remarks This function will invalidate the hFile handle, which then becomes unusable. Avoid calling this function if an asynchronous transfer is in progress. Return Value Description S_OK The function succeeded. E_HANDLE The handle is invalid or the file failed to close.
  • Page 20: Deleteevent

    Return value S_OK The function succeeded. 9.6 DeleteEvent The DeleteEvent function deletes a synchronization event employed during asynchronous file transfers. HRESULT DeleteEvent(AmdDxLfEventHandle hEvent); hEvent [in] SSG event handle to be deleted. Remarks Avoid deleting an event handle if used in asynchronous file transfers but those transfers finished executing before the event.
  • Page 21: Readbufferfromfile

    9.8 ReadBufferFromFile The ReadBufferFromFile function transfers file information to the D3D11 buffer. The call can be synchronous or asynchronous, and it takes one or more regions to fill the destination buffer. Splitting the request into multiple smaller regions can improve performance. Note: During asynchronous transfers (between the transfer call and the WaitEvent call), avoid using the D3D buffer in the D3D pipeline or lock/unlock.
  • Page 22: Writebuffertofile

    9.9 WriteBufferToFile The WriteBufferToFile function transfers information from the D3D11 buffer to a file. The call can be synchronous or asynchronous. It takes one or more regions for writing to the file. Splitting the request into multiple smaller regions can improve performance. Note: During asynchronous transfers (between a transfer call and a WaitEvent call), avoid using the D3D buffer in the D3D pipeline or lock/unlock.
  • Page 23: Amd Code Sample For Directx

    10 AMD Code Sample for DirectX® // Create module handle. HMODULE hDxxDll = GetModuleHandle(DXX_DLL_NAME); if (hDxxExt == NULL) { std::cout << "Error: Unable to load DX library." << std::endl; return; // Initial function pointer from module. PFNAmdDxExtCreate11 pAmdDxExtCreate = reinterpret_cast<PFNAmdDxExtCreate11>(GetProcAddress(hDxxDll, "AmdDxExtCreate11")); if (pAmdDxExtCreate == nullptr) { std::cout <<...
  • Page 24 AmdDxLfRegionDesc regionDesc; regionDesc.fileOffset = FILE_OFFSET; regionDesc.bufferOffset = BUFF_OFFSET; regionDesc.regionSize = dxLFFileInfo.blockSize; // Read information from the file: BUFF_OFFSET, SIZE_TO_READ and FILE_OFFSET must // align with the sector size. hr = dxSsgExt->ReadBufferFromFile(pDxBuffer, hSsgFile, 1, &regionDescs, nullptr); if (FAILED(hr)) { std::cout << "Error: Unable to read data from file."...
  • Page 25 © 2017 Advanced Micro Devices, Inc. All rights reserved. AMD, the AMD Arrow logo, Radeon, and combinations thereof are trademarks of Advanced Micro Devices, Inc. in the United States and/or other jurisdictions. PCIe and PCI Express are registered trademarks of PCI-SIG. OpenGL is a registered trademark of Khronos Group.

Table of Contents