6 Replies Latest reply on Aug 10, 2010 9:09 AM by nou

    --device cpu

    AptypR

      Tomorrow I founded out that almost all samples didn't work.they quit with

      "Error: clCreateContextFromType failed. Error code : CL_DEVICE_NOT_FOUND",even if CLInfo and HelloCL works properly.

      After googling I tried to use --device cpu and it worked.

      Can I set some variable or something not to use "--device cpu" all the time I run opencl applications??

        • --device cpu
          omkaranathan

          You need to have a supported GPU and drivers to get the samples working on GPU. Which GPU are you having? Have you insatalled latest drivers?

          The samples other than CLInfo and HelloCL run on GPU by default.

          • --device cpu
            genaganna

             

            Originally posted by: AptypRCan I set some variable or something not to use "--device cpu" all the time I run opencl applications??

             

            Only one way to do this.  You need to change each sample to run by default on CPU.

             

            This is what is now in each sample

            ------------------------------------------------

            if(deviceType.compare("cpu") == 0)
                {
                    dType = CL_DEVICE_TYPE_CPU;
                }
                else //deviceType = "gpu"
                {
                    dType = CL_DEVICE_TYPE_GPU;
                }

             

            Modify as follows

            ----------------------------------------------

            if(deviceType.compare("gpu") == 0)
                {
                    dType = CL_DEVICE_TYPE_GPU;
                }
                else //deviceType = "cpu"
                {
                    dType = CL_DEVICE_TYPE_CPU;
                }