initial commit

[ROCm/clr commit: 3694ab2ce8]
此提交包含在:
foreman
2014-07-04 16:17:05 -04:00
父節點 b0b5b33fcf
當前提交 f80f2f233c
共有 351 個檔案被更改,包括 113713 行新增1 行删除
+71
查看文件
@@ -0,0 +1,71 @@
//
// Copyright (c) 2011 Advanced Micro Devices, Inc. All rights reserved.
//
#ifndef CPUKERNEL_HPP_
#define CPUKERNEL_HPP_
#include "top.hpp"
#include "device/device.hpp"
#include <amdocl/cl_kernel.h>
//! \namespace cpu CPU Device Implementation
namespace cpu {
//! \class CPU kernel
class Kernel : public device::Kernel
{
private:
const void* entryPoint_; //!< entry for the kernel
std::vector< std::pair<size_t, size_t> > args_;
public:
uint nature_; //!< kernel's nature
uint privateSize_; //!< WorkItem's private memory size (in bytes)
private:
//! Disable default copy constructor
Kernel(const Kernel&);
//! Disable operator=
Kernel& operator=(const Kernel&);
public:
void addArg(size_t size, size_t alignment) {
args_.push_back(std::pair<size_t, size_t>(size, alignment));
}
size_t getArgSize(int argIndex) const {
return args_[argIndex].first;
}
size_t getArgAlignment(int argIndex) const {
return args_[argIndex].second;
}
//! Default constructor
Kernel(const std::string& name)
: device::Kernel(name), entryPoint_(NULL), nature_(0),
privateSize_(CLK_PRIVATE_MEMORY_SIZE)
{
workGroupInfo_.size_ = CPU_MAX_WORKGROUP_SIZE;
}
//! Default destructor
~Kernel() {}
//! Returns the CPU kernel entry point
const void* getEntryPoint() const { return entryPoint_; }
//! Sets the CPU kernel entry point
void setEntryPoint(const void* entryPoint) { entryPoint_ = entryPoint; }
//! Returns true if the kernel has a call to barrier
bool hasBarrier() const { return 0 != (nature_ & KN_HAS_BARRIER); }
//! Returns the private memory size of a single WorkItem
uint getWorkItemPrivateMemSize() const { return privateSize_; }
};
} // namespace cpu
#endif // CPUKERNEL_HPP_