'\" t .\" Title: clCreateSampler .\" Author: The Khronos Group .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 01/14/2021 .\" Manual: OpenCL Manual .\" Source: The Khronos Group .\" Language: English .\" .TH "CLCREATESAMPLER" "3clc" "01/14/2021" "The Khronos Group" "OpenCL Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" clCreateSampler \- Creates a sampler object\&. .SH "" .HP \w'cl_sampler\ clCreateSampler('u .BI "cl_sampler clCreateSampler(cl_context\ " "context" ", cl_bool\ " "normalized_coords" ", cl_addressing_mode\ " "addressing_mode" ", cl_filter_mode\ " "filter_mode" ", cl_int\ *" "errcode_ret" ");" .SH "PARAMETERS" .PP \fI context \fR .RS 4 Must be a valid OpenCL context\&. .RE .PP \fI normalized_coords \fR .RS 4 Determines if the image coordinates specified are normalized (if \fInormalized_coords\fR is \fBCL_TRUE\fR) or not (if \fInormalized_coords\fR is \fBCL_FALSE\fR)\&. .RE .PP \fI addressing_mode \fR .RS 4 Specifies how out\-of\-range image coordinates are handled when reading from an image\&. This can be set to \fBCL_ADDRESS_MIRRORED_REPEAT\fR, \fBCL_ADDRESS_REPEAT\fR, \fBCL_ADDRESS_CLAMP_TO_EDGE\fR, \fBCL_ADDRESS_CLAMP\fR, and \fBCL_ADDRESS_NONE\fR\&. .RE .PP \fI filter_mode \fR .RS 4 Specifies the type of filter that must be applied when reading an image\&. This can be \fBCL_FILTER_NEAREST\fR or \fBCL_FILTER_LINEAR\fR\&. .RE .PP \fI errcode_ret \fR .RS 4 Returns an appropriate error code\&. If \fIerrcode_ret\fR is NULL, no error code is returned\&. .RE .SH "NOTES" .PP A sampler object describes how to sample an image when the image is read in the kernel\&. The built\-in functions to read from an image in a kernel take a sampler as an argument\&. The sampler arguments to the image read function can be sampler objects created using OpenCL functions and passed as argument values to the kernel or can be samplers declared inside a kernel\&. In this section we discuss how sampler objects are created using OpenCL functions\&. .PP For more information about working with samplers, see \fBsampler_t\fR(3clc) .SH "ERRORS" .PP Returns a valid non\-zero sampler object and \fIerrcode_ret\fR is set to CL_SUCCESS if the sampler object is created successfully\&. Otherwise, it returns a NULL value with one of the following error values returned in \fIerrcode_ret\fR: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_INVALID_CONTEXT if \fIcontext\fR is not a valid context\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_INVALID_VALUE if \fIaddressing_mode\fR, \fIfilter_mode\fR, or \fInormalized_coords\fR or a combination of these argument values are not valid\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_INVALID_OPERATION if images are not supported by any device associated with \fIcontext\fR (i\&.e\&. CL_DEVICE_IMAGE_SUPPORT specified in the table of OpenCL Device Queries for \fBclGetDeviceInfo\fR(3clc) is CL_FALSE)\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host\&. .RE .SH "SPECIFICATION" .PP \m[blue]\fBOpenCL Specification\fR\m[]\&\s-2\u[1]\d\s+2 .SH "SEE ALSO" .PP \fBclRetainSampler\fR(3clc), \fBclReleaseSampler\fR(3clc), \fBclGetSamplerInfo\fR(3clc), \fBclassDiagram\fR(3clc) \fBsampler_t\fR(3clc) .SH "AUTHORS" .PP \fBThe Khronos Group\fR .SH "COPYRIGHT" .br Copyright \(co 2007-2011 The Khronos Group Inc. .br Permission is hereby granted, free of charge, to any person obtaining a copy of this software and/or associated documentation files (the "Materials"), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Materials, and to permit persons to whom the Materials are furnished to do so, subject to the condition that this copyright notice and permission notice shall be included in all copies or substantial portions of the Materials. .sp .SH "NOTES" .IP " 1." 4 OpenCL Specification .RS 4 \%page 128, section 5.5.1 - Creating Sampler Objects .RE