P4 to Git Change 1477581 by wchau@wchau_WIN_OCL_HSA on 2017/11/01 16:33:34

SWDEV-136305 - [OCL 2.1 Plat] API calls for all drivers

Affected files ...

... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_command.cpp#15 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_svm.cpp#22 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/command.hpp#87 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/context.hpp#27 edit


[ROCm/clr commit: bafc102e17]
This commit is contained in:
foreman
2017-11-01 16:53:27 -04:00
parent fa72a9a820
commit d1584c846c
2 changed files with 4 additions and 44 deletions
@@ -1232,50 +1232,6 @@ class SvmUnmapMemoryCommand : public Command {
void* svmPtr() const { return svmPtr_; }
};
/*! \brief Enqueues a command to indicate which device a set of ranges of SVM allocations
* should be associated with.
*/
class SvmMigrateMemCommand: public Command {
private:
cl_mem_migration_flags migrationFlags_; //!< Migration flags
std::vector<const void*> svmPointers_; //!< The list of SVM pointers
std::vector<size_t> svmSizes_; //!< Number of bytes to be migrated for svm_pointers[i]
public:
SvmMigrateMemCommand(HostQueue& queue, const EventWaitList& eventWaitList,
cl_uint numSvmPointers, const void** svmPointers,
const size_t *size, cl_mem_migration_flags flags)
: Command(queue, CL_COMMAND_SVM_MIGRATE_MEM, eventWaitList), migrationFlags_(flags) {
for (cl_uint i=0; i < numSvmPointers; i++) {
svmPointers_.push_back(svmPointers[i]);
if (size == NULL) {
svmSizes_.push_back(0);
}
else {
svmSizes_.push_back(size[i]);
}
}
}
virtual void submit(device::VirtualDevice& device) {
//TODO: implement the submit function to the support device
// i.e. device.submitSvmMigrateMem(*this);
return;
}
//! Returns the migration flags
cl_mem_migration_flags migrationFlags() const { return migrationFlags_; }
//! Returns the number of svm pointers in the command
cl_uint numSvmPointers() const { return (cl_uint)svmPointers_.size(); }
//! Returns a pointer to the svm pointers
const void* svmPointer(uint i) const { return svmPointers_[i]; }
//! Returns a pointer to the size of svm range
const size_t svmSize(uint i) const { return svmSizes_[i]; }
};
/*! \brief A generic transfer memory from/to file command.
*
* \details Currently supports buffers only. Buffers
@@ -187,6 +187,10 @@ class Context : public RuntimeObject {
DeviceQueue* queue //!< Device queue
);
//! Set the default device queue
void setDefDeviceQueue(const Device& dev, DeviceQueue* queue)
{ deviceQueues_[&dev].defDeviceQueue_ = queue; };
private:
const Info info_; //!< Context info structure
cl_context_properties* properties_; //!< Original properties