Edit

kc3-lang/angle/src/libANGLE/CLBuffer.cpp

Branch :

  • Show log

    Commit

  • Author : John Plate
    Date : 2021-05-31 12:04:42
    Hash : daf18594
    Message : CL: Refactor front end entry functions Move all front end functions that are only called from the OpenCL entry points to a separate section at the top of the front end object class bodies, which improves readability. Bug: angleproject:6001 Change-Id: Id360adbf0c439e4068c379aa4ea1da25e99f7b53 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2928419 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>

  • src/libANGLE/CLBuffer.cpp
  • //
    // Copyright 2021 The ANGLE Project Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style license that can be
    // found in the LICENSE file.
    //
    // CLBuffer.cpp: Implements the cl::Buffer class.
    
    #include "libANGLE/CLBuffer.h"
    
    namespace cl
    {
    
    cl_mem Buffer::createSubBuffer(MemFlags flags,
                                   cl_buffer_create_type createType,
                                   const void *createInfo,
                                   cl_int &errorCode)
    {
        const cl_buffer_region &region = *static_cast<const cl_buffer_region *>(createInfo);
        return Object::Create<Buffer>(errorCode, *this, flags, region.origin, region.size);
    }
    
    Buffer::~Buffer() = default;
    
    Buffer::Buffer(Context &context,
                   PropArray &&properties,
                   MemFlags flags,
                   size_t size,
                   void *hostPtr,
                   cl_int &errorCode)
        : Memory(*this, context, std::move(properties), flags, size, hostPtr, errorCode)
    {}
    
    Buffer::Buffer(Buffer &parent, MemFlags flags, size_t offset, size_t size, cl_int &errorCode)
        : Memory(*this, parent, flags, offset, size, errorCode)
    {}
    
    }  // namespace cl