global(3clc)


NAME

   __global - Address space qualifier.

   __global global

DESCRIPTION

   OpenCL implements the following disjoint address spaces: __global,
   __local, __constant, and __private The address space qualifier may be
   used in variable declarations to specify the region of memory that is
   used to allocate the object. The C syntax for type qualifiers is
   extended in OpenCL to include an address space name as a valid type
   qualifier. If the type of an object is qualified by an address space
   name, the object is allocated in the specified address name; otherwise,
   the object is allocated in the generic address space.

   The address space names without the __prefix i.e.  global, local,
   constant and private may be substituted for the corresponding address
   space names with the __prefix.

   The generic address space name for arguments to a function in a
   program, or local variables of a function is __private. All function
   arguments shall be in the __private address space.

   functionQualifiers(3clc) function arguments declared to be a pointer of
   a type can point to one of the following address spaces only: __global,
   __local or __constant. A pointer to address space A can only be
   assigned to a pointer to the same address space A. Casting a pointer to
   address space A to a pointer to address space B is illegal.

   Function arguments of type otherDataTypes(3clc), otherDataTypes(3clc),
   otherDataTypes(3clc), otherDataTypes(3clc), otherDataTypes(3clc), and
   otherDataTypes(3clc) refer to image memory objects allocated in the
   __global address space.

NOTES

   The __global or global address space name is used to refer to memory
   objects (buffer or image objects) allocated from the global memory
   pool.

   A buffer memory object can be declared as a pointer to a scalar, vector
   or user-defined struct. This allows the kernel to read and/or write any
   location in the buffer.

   The actual size of the array memory object is determined when the
   memory object is allocated via appropriate API calls in the host code.

   If an image object is attached to an argument declared with this
   qualifier, the argument must be declared as type otherDataTypes(3clc)
   for a 2D image object, as type otherDataTypes(3clc) for a 3D image
   object, as type otherDataTypes(3clc) for a 2D image array object, as
   type otherDataTypes(3clc) for a 1D image object, as type
   otherDataTypes(3clc) for a 1D image buffer object, and as type
   otherDataTypes(3clc) for a 1D image array object. The elements of an
   image object cannot be directly accessed. Built-in functions to read
   from and write to an image object are provided.

   The const qualifier can also be used with the __global qualifier to
   specify a read-only buffer memory object.

   Examples
   There is no generic address space name for program scope variables. All
   program scope variables must be declared in the __constant address
   space. For example:

   // declares a pointer p in the
   __private address space that // points
   to an int object in address space
   __global __global int *p;

   // declares an array of 4 floats in the
   __private address space.  float x[4];

   There is no address space for function return values. Using an address
   space qualifier in a function return type declaration will generate a
   compilation error, unless the return type is declared as a pointer type
   and the qualifier is used on the points-to address space.

   For example:

   __private int f() { ... } // should
   generate an error __local int *f() {
   ... } // allowed __local int *
   __private f() { ... }; // should
   generate an error.

   __global float4  *color;      // An
   array of float4 elements typedef struct
   { float a[3]; int   b[2]; } foo_t;
   __global foo_t   *my_info;    // An
   array of foo_t elements.

SPECIFICATION

   OpenCL Specification[1]

SEE ALSO

   local(3clc), constant(3clc), private(3clc)

AUTHORS

   The Khronos Group

COPYRIGHT

   Copyright  2007-2011 The Khronos Group Inc.
   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.

NOTES

    1. OpenCL Specification
       page 222, section 6.5 - Address Space Qualifiers





Opportunity


Personal Opportunity - Free software gives you access to billions of dollars of software at no cost. Use this software for your business, personal use or to develop a profitable skill. Access to source code provides access to a level of capabilities/information that companies protect though copyrights. Open source is a core component of the Internet and it is available to you. Leverage the billions of dollars in resources and capabilities to build a career, establish a business or change the world. The potential is endless for those who understand the opportunity.

Business Opportunity - Goldman Sachs, IBM and countless large corporations are leveraging open source to reduce costs, develop products and increase their bottom lines. Learn what these companies know about open source and how open source can give you the advantage.





Free Software


Free Software provides computer programs and capabilities at no cost but more importantly, it provides the freedom to run, edit, contribute to, and share the software. The importance of free software is a matter of access, not price. Software at no cost is a benefit but ownership rights to the software and source code is far more significant.


Free Office Software - The Libre Office suite provides top desktop productivity tools for free. This includes, a word processor, spreadsheet, presentation engine, drawing and flowcharting, database and math applications. Libre Office is available for Linux or Windows.





Free Books


The Free Books Library is a collection of thousands of the most popular public domain books in an online readable format. The collection includes great classical literature and more recent works where the U.S. copyright has expired. These books are yours to read and use without restrictions.


Source Code - Want to change a program or know how it works? Open Source provides the source code for its programs so that anyone can use, modify or learn how to write those programs themselves. Visit the GNU source code repositories to download the source.





Education


Study at Harvard, Stanford or MIT - Open edX provides free online courses from Harvard, MIT, Columbia, UC Berkeley and other top Universities. Hundreds of courses for almost all major subjects and course levels. Open edx also offers some paid courses and selected certifications.


Linux Manual Pages - A man or manual page is a form of software documentation found on Linux/Unix operating systems. Topics covered include computer programs (including library and system calls), formal standards and conventions, and even abstract concepts.