Beispiel #1
0
def vglClInit(ocl_context_a=None, ss_a=None, bin_image_pack_size_a=None):
    global ocl
    global ocl_context
    global struct_sizes
    global bin_image_pack_size

    # INITIATING OCL_CONTEXT
    if (ocl_context is None):
        ocl_context = vl.opencl_context()
        ocl = ocl_context.get_vglClContext_attributes()
    else:
        ocl_context = ocl_context_a
        ocl = ocl_context.get_vglClContext_attributes()

    # INITIATING STRUCT SIZES
    if (ss_a is None):
        ss = vl.struct_sizes()
        struct_sizes = ss.get_struct_sizes()
        ss = None
    else:
        struct_sizes = ss_a.get_struct_sizes()

    # INITIATING BIN_IMAGE_PACK_SIZE
    if ((bin_image_pack_size_a == vl.PACK_SIZE_8())
            or (bin_image_pack_size_a == vl.PACK_SIZE_32())
            or (bin_image_pack_size_a == vl.PACK_SIZE_64())):
        bin_image_pack_size = bin_image_pack_size_a
    elif (bin_image_pack_size_a is None):
        print("vglClInit: Warning: Assuming bin_image_pack_size as 8")
        bin_image_pack_size = vl.PACK_SIZE_8()
    else:
        print(
            "vglClInit: Error! bin_image_pack_size not 8, 32 or 64. Ending execution."
        )
        exit()
Beispiel #2
0
def VGL_PACK_CL_SHADER_TYPE():
	if( vl.get_bin_image_pack_size is None ):
		vl.vglClInit()

	if( vl.get_bin_image_pack_size == vl.PACK_SIZE_8() ):
		return VGL_PACK_CL_SHADER_TYPE_8()
	elif( vl.get_bin_image_pack_size == vl.PACK_SIZE_32() ):
		return VGL_PACK_CL_SHADER_TYPE_32()
	elif( vl.get_bin_image_pack_size == vl.PACK_SIZE_64() ):
		return VGL_PACK_CL_SHADER_TYPE_64()

	print("VGL_PACK_CL_SHADER_TYPE: Error! get_bin_image_pack_size not 8, 32 or 64.")
	exit()
Beispiel #3
0
def VGL_PACK_OUTPUT_DIRECT_MASK():
	if( vl.get_bin_image_pack_size is None ):
		vl.vglClInit()

	if( vl.get_bin_image_pack_size == vl.PACK_SIZE_8() ):
		return VGL_PACK_OUTPUT_DIRECT_MASK_8()
	elif( vl.get_bin_image_pack_size == vl.PACK_SIZE_32() ):
		return VGL_PACK_OUTPUT_DIRECT_MASK_32()
	elif( vl.get_bin_image_pack_size == vl.PACK_SIZE_64() ):
		return VGL_PACK_OUTPUT_DIRECT_MASK_64()

	print("VGL_PACK_SIZE_BITS: Error! get_bin_image_pack_size not 8, 32 or 64.")
	exit()
Beispiel #4
0
def VGL_PACK_MAX_UINT():
	if( vl.get_bin_image_pack_size is None ):
		vl.vglClInit()

	if( vl.get_bin_image_pack_size == vl.PACK_SIZE_8() ):
		return VGL_PACK_MAX_UINT_8()
	elif( vl.get_bin_image_pack_size == vl.PACK_SIZE_32() ):
		return VGL_PACK_MAX_UINT_32()
	elif( vl.get_bin_image_pack_size == vl.PACK_SIZE_64() ):
		return VGL_PACK_MAX_UINT_64()

	print("VGL_PACK_MAX_UINT: Error! get_bin_image_pack_size not 8, 32 or 64.")
	exit()