Khronos Public Bugzilla
View | Details | Raw Unified | Return to bug 254
Collapse All | Expand All

(-)C:\Development\Projects\Work\amira\product\include\arch-Win64VC8\CL\cl.hpp.orig (-9 / +23 lines)
 Lines 717-739    Link Here 
717
        return CL_SUCCESS;
717
        return CL_SUCCESS;
718
    }
718
    }
719
};
719
};
720
720
721
// Specialized for getInfo<CL_PROGRAM_BINARIES>
721
// Specialized for getInfo<CL_PROGRAM_BINARIES>
722
template <typename Func>
722
template <typename Func>
723
struct GetInfoHelper<Func, VECTOR_CLASS<char *> >
723
struct GetInfoHelper<Func, VECTOR_CLASS< VECTOR_CLASS<unsigned char> > >
724
{
724
{
725
    static cl_int
725
    static cl_int
726
    get(Func f, cl_uint name, VECTOR_CLASS<char *>* param)
726
    get(Func f, cl_uint name, VECTOR_CLASS< VECTOR_CLASS<unsigned char> >* param)
727
    {
727
    {
728
      cl_uint err = f(name, param->size() * sizeof(char *), &(*param)[0], NULL);
728
        VECTOR_CLASS< ::size_t> sizes;
729
      if (err != CL_SUCCESS) {
729
        cl_int err = GetInfoHelper<Func, VECTOR_CLASS< ::size_t> >::get(f, CL_PROGRAM_BINARY_SIZES, &sizes);
730
        return err;
730
        if (err != CL_SUCCESS) {
731
      }
731
            return err;
732
      
732
        }
733
      return CL_SUCCESS;
733
734
        param->resize(sizes.size());
735
736
        VECTOR_CLASS<unsigned char*> values(param->size());
737
        for (::size_t i = 0; i<param->size(); ++i) {
738
            (*param)[i].resize(sizes[i]);
739
            values[i]=&(*param)[i].front();
740
        }
741
742
        err = f(name, values.size() * sizeof(unsigned char *), &values[0], NULL);
743
        if (err != CL_SUCCESS) {
744
            return err;
745
        }
746
747
        return CL_SUCCESS;
734
    }
748
    }
735
};
749
};
736
750
737
// Specialized GetInfoHelper for STRING_CLASS params
751
// Specialized GetInfoHelper for STRING_CLASS params
738
template <typename Func>
752
template <typename Func>
739
struct GetInfoHelper<Func, STRING_CLASS>
753
struct GetInfoHelper<Func, STRING_CLASS>
 Lines 872-884    Link Here 
872
    F(cl_program_info, CL_PROGRAM_REFERENCE_COUNT, cl_uint) \
886
    F(cl_program_info, CL_PROGRAM_REFERENCE_COUNT, cl_uint) \
873
    F(cl_program_info, CL_PROGRAM_CONTEXT, cl::Context) \
887
    F(cl_program_info, CL_PROGRAM_CONTEXT, cl::Context) \
874
    F(cl_program_info, CL_PROGRAM_NUM_DEVICES, cl_uint) \
888
    F(cl_program_info, CL_PROGRAM_NUM_DEVICES, cl_uint) \
875
    F(cl_program_info, CL_PROGRAM_DEVICES, VECTOR_CLASS<cl_device_id>) \
889
    F(cl_program_info, CL_PROGRAM_DEVICES, VECTOR_CLASS<cl_device_id>) \
876
    F(cl_program_info, CL_PROGRAM_SOURCE, STRING_CLASS) \
890
    F(cl_program_info, CL_PROGRAM_SOURCE, STRING_CLASS) \
877
    F(cl_program_info, CL_PROGRAM_BINARY_SIZES, VECTOR_CLASS< ::size_t>) \
891
    F(cl_program_info, CL_PROGRAM_BINARY_SIZES, VECTOR_CLASS< ::size_t>) \
878
    F(cl_program_info, CL_PROGRAM_BINARIES, VECTOR_CLASS<char *>) \
892
    F(cl_program_info, CL_PROGRAM_BINARIES, VECTOR_CLASS< VECTOR_CLASS<unsigned char> >) \
879
    \
893
    \
880
    F(cl_program_build_info, CL_PROGRAM_BUILD_STATUS, cl_build_status) \
894
    F(cl_program_build_info, CL_PROGRAM_BUILD_STATUS, cl_build_status) \
881
    F(cl_program_build_info, CL_PROGRAM_BUILD_OPTIONS, STRING_CLASS) \
895
    F(cl_program_build_info, CL_PROGRAM_BUILD_OPTIONS, STRING_CLASS) \
882
    F(cl_program_build_info, CL_PROGRAM_BUILD_LOG, STRING_CLASS) \
896
    F(cl_program_build_info, CL_PROGRAM_BUILD_LOG, STRING_CLASS) \
883
    \
897
    \
884
    F(cl_kernel_info, CL_KERNEL_FUNCTION_NAME, STRING_CLASS) \
898
    F(cl_kernel_info, CL_KERNEL_FUNCTION_NAME, STRING_CLASS) \

Return to bug 254