"Fossies" - the Fresh Open Source Software Archive

Member "pocl-1.8/examples/AMDSDK2.9/AMDSDK2_9.patch" (12 Oct 2021, 9966 Bytes) of package /linux/misc/pocl-1.8.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Diff source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 diff -uNr a/AMD-APP-SDK-v2.9-RC-lnx64/samples/opencl/benchmark/MemoryOptimizations/MemoryOptimizations.cpp b/AMD-APP-SDK-v2.9-RC-lnx64/samples/opencl/benchmark/MemoryOptimizations/MemoryOptimizations.cpp
    2 --- a/AMD-APP-SDK-v2.9-RC-lnx64/samples/opencl/benchmark/MemoryOptimizations/MemoryOptimizations.cpp    2013-10-30 12:38:58.000000000 +0200
    3 +++ b/AMD-APP-SDK-v2.9-RC-lnx64/samples/opencl/benchmark/MemoryOptimizations/MemoryOptimizations.cpp    2014-01-31 10:53:21.299733573 +0200
    4 @@ -185,12 +185,12 @@
    5      //Set device info of given cl_device_id
    6      retValue = deviceInfo.setDeviceInfo(devices[sampleArgs->deviceId]);
    7      CHECK_ERROR(retValue, SDK_SUCCESS, "SDKDeviceInfo::setDeviceInfo() failed");
    8 -
    9 +    /*
   10      if(!strstr(deviceInfo.extensions, "cl_khr_global_int32_base_atomics"))
   11      {
   12          OPENCL_EXPECTED_ERROR("Device does not support global_int32_base_atomics!");
   13      }
   14 -
   15 +    */
   16      {
   17          // The block is to move the declaration of prop closer to its use
   18          cl_command_queue_properties prop = 0;
   19 diff -uNr a/AMD-APP-SDK-v2.9-RC-lnx64/samples/opencl/cl/BufferBandwidth/Shared.cpp b/AMD-APP-SDK-v2.9-RC-lnx64/samples/opencl/cl/BufferBandwidth/Shared.cpp
   20 --- a/AMD-APP-SDK-v2.9-RC-lnx64/samples/opencl/cl/BufferBandwidth/Shared.cpp    2013-10-30 12:39:00.000000000 +0200
   21 +++ b/AMD-APP-SDK-v2.9-RC-lnx64/samples/opencl/cl/BufferBandwidth/Shared.cpp    2014-01-31 10:53:21.299733573 +0200
   22 @@ -152,12 +152,14 @@
   23      clGetDeviceInfo(device, CL_DEVICE_EXTENSIONS, extStringSize, deviceExtensions, NULL);
   24  
   25      // Check if cl_khr_fp64 extension is supported 
   26 +    /*
   27      if(!strstr(deviceExtensions, "cl_khr_local_int32_base_atomics"))
   28      {
   29          fprintf( stderr, "Device does not support cl_khr_local_int32_base_atomics extension!\n");
   30          delete deviceExtensions;
   31          exit(0);
   32      }
   33 +    */
   34      delete deviceExtensions;
   35  
   36      // Get OpenCL device version
   37 @@ -266,15 +268,17 @@
   38      }
   39  
   40      ret = clGetDeviceIDs( platform,
   41 -                          devs[1],
   42 +                          devs[0],
   43                            128,
   44                            devices,
   45                            &num_devices );
   46 +    /*
   47      if((ret == CL_DEVICE_NOT_FOUND) || (num_devices == 0))
   48      {
   49          fprintf( stderr, "This sample requires a GPU to be present in order to execute");
   50          exit(FAILURE);
   51      }
   52 +    */
   53      ASSERT_CL_RETURN( ret );
   54  
   55      device = devices[devnum];
   56 diff -uNr a/AMD-APP-SDK-v2.9-RC-lnx64/samples/opencl/cl/ImageBandwidth/Shared.cpp b/AMD-APP-SDK-v2.9-RC-lnx64/samples/opencl/cl/ImageBandwidth/Shared.cpp
   57 --- a/AMD-APP-SDK-v2.9-RC-lnx64/samples/opencl/cl/ImageBandwidth/Shared.cpp 2013-10-30 12:39:02.000000000 +0200
   58 +++ b/AMD-APP-SDK-v2.9-RC-lnx64/samples/opencl/cl/ImageBandwidth/Shared.cpp 2014-01-31 10:53:21.300733603 +0200
   59 @@ -150,12 +150,14 @@
   60      clGetDeviceInfo(device, CL_DEVICE_EXTENSIONS, extStringSize, deviceExtensions, NULL);
   61  
   62      /* Check if cl_khr_fp64 extension is supported */
   63 +    /*
   64      if(!strstr(deviceExtensions, "cl_khr_local_int32_base_atomics"))
   65      {
   66          fprintf( stderr, "Device does not support cl_khr_local_int32_base_atomics extension!\n");
   67          delete deviceExtensions;
   68          exit(EXPECTED_FAILURE);
   69      }
   70 +    */
   71      delete deviceExtensions;
   72  
   73      /* Check for image support */
   74 @@ -270,7 +272,7 @@
   75      }
   76  
   77      ret = clGetDeviceIDs( platform,
   78 -                          devs[1],
   79 +                          devs[0],
   80                            128,
   81                            devices,
   82                            &num_devices );
   83 diff -uNr a/AMD-APP-SDK-v2.9-RC-lnx64/samples/opencl/cl/KernelLaunch/KernelLaunch.cpp b/AMD-APP-SDK-v2.9-RC-lnx64/samples/opencl/cl/KernelLaunch/KernelLaunch.cpp
   84 --- a/AMD-APP-SDK-v2.9-RC-lnx64/samples/opencl/cl/KernelLaunch/KernelLaunch.cpp 2013-10-30 12:39:02.000000000 +0200
   85 +++ b/AMD-APP-SDK-v2.9-RC-lnx64/samples/opencl/cl/KernelLaunch/KernelLaunch.cpp 2014-01-31 10:53:30.408010010 +0200
   86 @@ -410,7 +410,7 @@
   87        tlog->Msg( "\n%s\n\n", "GPU kernel read of inputBuffer" );
   88  
   89        for(int i = 0; i < nRepeats; i++)
   90 -          timedReadKernelVerify( queue, read_kernel, inputBuffer, resultBuffer, nl & 0xff, true );
   91 +          timedReadKernelVerify( queue, read_kernel, inputBuffer, resultBuffer, nl & 0xff, false );
   92  
   93        tlog->Msg( "%s\n", "" );
   94     }
   95 diff -uNr a/AMD-APP-SDK-v2.9-RC-lnx64/samples/opencl/cl/KernelLaunch/Shared.cpp b/AMD-APP-SDK-v2.9-RC-lnx64/samples/opencl/cl/KernelLaunch/Shared.cpp
   96 --- a/AMD-APP-SDK-v2.9-RC-lnx64/samples/opencl/cl/KernelLaunch/Shared.cpp   2013-10-30 12:39:02.000000000 +0200
   97 +++ b/AMD-APP-SDK-v2.9-RC-lnx64/samples/opencl/cl/KernelLaunch/Shared.cpp   2014-01-31 10:53:21.300733603 +0200
   98 @@ -203,7 +203,7 @@
   99      }
  100  
  101      ret = clGetDeviceIDs( platform,
  102 -                          devs[1],
  103 +                          devs[0],
  104                            128,
  105                            devices,
  106                            &num_devices );
  107 @@ -243,13 +243,14 @@
  108  
  109      ASSERT_CL_RETURN( ret );
  110  
  111 +    /*
  112      if(strstr(extensions,"cl_khr_local_int32_base_atomics") == NULL)
  113      {
  114          printf("Expected Error: cl_khr_local_int32_base_atomics is not supported by the device/n");
  115          status = EXPECTED_FAILURE;
  116         return;
  117      }
  118 -
  119 +    */
  120      context = clCreateContext( NULL,
  121                                 1,
  122                                 &device,
  123 diff -uNr a/AMD-APP-SDK-v2.9-RC-lnx64/samples/opencl/cl/TransferOverlap/TransferOverlap.cpp b/AMD-APP-SDK-v2.9-RC-lnx64/samples/opencl/cl/TransferOverlap/TransferOverlap.cpp
  124 --- a/AMD-APP-SDK-v2.9-RC-lnx64/samples/opencl/cl/TransferOverlap/TransferOverlap.cpp   2013-10-30 12:39:51.000000000 +0200
  125 +++ b/AMD-APP-SDK-v2.9-RC-lnx64/samples/opencl/cl/TransferOverlap/TransferOverlap.cpp   2014-01-31 10:53:21.301733633 +0200
  126 @@ -158,11 +158,12 @@
  127      CHECK_ERROR(retValue, SDK_SUCCESS, "SDKDeviceInfo::setDeviceInfo() failed");
  128  
  129      // Check device extensions
  130 +    /*
  131      if(!strstr(deviceInfo.extensions, "cl_khr_local_int32_base_atomics"))
  132      {
  133          OPENCL_EXPECTED_ERROR("Device does not support cl_khr_local_int32_base_atomics extension!");
  134      }
  135 -
  136 +    */
  137      // Get OpenCL device version
  138      std::string deviceVersionStr = std::string(deviceInfo.deviceVersion);
  139      size_t vStart = deviceVersionStr.find(" ", 0);
  140 diff -uNr a/AMD-APP-SDK-v2.9-RC-lnx64/samples/opencl/cpp_cl/AsyncDataTransfer/AsyncDataTransfer.cpp b/AMD-APP-SDK-v2.9-RC-lnx64/samples/opencl/cpp_cl/AsyncDataTransfer/AsyncDataTransfer.cpp
  141 --- a/AMD-APP-SDK-v2.9-RC-lnx64/samples/opencl/cpp_cl/AsyncDataTransfer/AsyncDataTransfer.cpp   2013-10-30 12:39:52.000000000 +0200
  142 +++ b/AMD-APP-SDK-v2.9-RC-lnx64/samples/opencl/cpp_cl/AsyncDataTransfer/AsyncDataTransfer.cpp   2014-01-31 10:54:28.112760742 +0200
  143 @@ -469,7 +469,7 @@
  144      {
  145          status |= readQueue.enqueueUnmapMemObject(inPrepinBuffer[k], input[k], NULL,
  146                    NULL);
  147 -        status |= readQueue.enqueueUnmapMemObject(outPrepinBuffer[k], input[k], NULL,
  148 +        status |= readQueue.enqueueUnmapMemObject(outPrepinBuffer[k], output[k], NULL,
  149                    NULL);
  150          CHECK_ERROR(status, SDK_SUCCESS, "Failed enqueueUnmapMemObject(PrepinBuffers)");
  151      }
  152 diff -uNr a/AMD-APP-SDK-v2.9-RC-lnx64/samples/opencl/cpp_cl/CplusplusWrapper/CplusplusWrapper.cpp b/AMD-APP-SDK-v2.9-RC-lnx64/samples/opencl/cpp_cl/CplusplusWrapper/CplusplusWrapper.cpp
  153 --- a/AMD-APP-SDK-v2.9-RC-lnx64/samples/opencl/cpp_cl/CplusplusWrapper/CplusplusWrapper.cpp 2013-10-30 12:39:52.000000000 +0200
  154 +++ b/AMD-APP-SDK-v2.9-RC-lnx64/samples/opencl/cpp_cl/CplusplusWrapper/CplusplusWrapper.cpp 2014-01-31 10:53:21.302733663 +0200
  155 @@ -123,11 +123,13 @@
  156      
  157      cl::Event e;
  158     cl::Platform platform = cl::Platform::getDefault();
  159 +    /*
  160     if(strcmp(platform.getInfo<CL_PLATFORM_VENDOR>().c_str(), "Advanced Micro Devices, Inc."))
  161     {
  162         std::cout<<"Default platform should be Advanced Micro Devices, Inc. to run this sample\n"<<std::endl;
  163         exit(FAILURE);
  164     }
  165 +    */
  166      // set arguments for kernel, and execute it.
  167      cl::NDRange ndrg(NUM_ELEMENTS);
  168      cl::NDRange ndrl(NUM_ELEMENTS);
  169 diff -uNr a/AMD-APP-SDK-v2.9-RC-lnx64/samples/opencl/cpp_cl/HistogramAtomics/HistogramAtomics.cpp b/AMD-APP-SDK-v2.9-RC-lnx64/samples/opencl/cpp_cl/HistogramAtomics/HistogramAtomics.cpp
  170 --- a/AMD-APP-SDK-v2.9-RC-lnx64/samples/opencl/cpp_cl/HistogramAtomics/HistogramAtomics.cpp 2013-10-30 12:39:55.000000000 +0200
  171 +++ b/AMD-APP-SDK-v2.9-RC-lnx64/samples/opencl/cpp_cl/HistogramAtomics/HistogramAtomics.cpp 2014-01-31 10:53:21.303733694 +0200
  172 @@ -230,12 +230,13 @@
  173                                          cl_uint4));
  174  
  175      // Check if byte-addressable store is supported
  176 +    /*
  177      if(!strstr(deviceInfo.extensions, "cl_khr_local_int32_base_atomics"))
  178      {
  179          reqdExtSupport = false;
  180          OPENCL_EXPECTED_ERROR("Device does not support local_int32_base_atomics extension!");
  181      }
  182 -
  183 +    */
  184      // Create input buffer
  185      inputBuffer = clCreateBuffer(context,
  186                                   CL_MEM_READ_ONLY,
  187 
  188 --- a/AMD-APP-SDK-v2.9-RC-lnx64/samples/opencl/cl/DeviceFission/DeviceFission.cpp
  189 +++ b/AMD-APP-SDK-v2.9-RC-lnx64/samples/opencl/cl/DeviceFission/DeviceFission.cpp
  190 @@ -97,7 +97,7 @@
  191      {
  192          retValue = deviceInfo.setDeviceInfo(Devices[i]);
  193          CHECK_ERROR(retValue, 0, "SDKDeviceInfo::setDeviceInfo() failed");
  194 -        if (deviceInfo.dType == CL_DEVICE_TYPE_CPU)
  195 +        if (deviceInfo.dType & CL_DEVICE_TYPE_CPU)
  196          {
  197              cpuDevice = Devices[i];
  198          }
  199 @@ -137,6 +137,14 @@
  200                                  NULL);
  201      CHECK_OPENCL_ERROR( status, "clCreateSubDevices failed.");
  202  
  203 +    // recreate the context with the subdevices
  204 +    status = clReleaseContext(rContext);
  205 +    CHECK_OPENCL_ERROR( status, "clReleaseContext failed.");
  206 +
  207 +    rContext = clCreateContext(platform ? cps : NULL,
  208 +       numSubDevices, subDevices, NULL, NULL, &status);
  209 +    CHECK_OPENCL_ERROR( status, "clCreateContext failed.");
  210 +
  211      return SDK_SUCCESS;
  212  }
  213