2016-07-21 12:41:26 -04:00
|
|
|
//
|
|
|
|
|
// Copyright (c) 2010 Advanced Micro Devices, Inc. All rights reserved.
|
|
|
|
|
//
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#ifndef WITHOUT_HSA_BACKEND
|
|
|
|
|
|
|
|
|
|
#include "library.hpp"
|
|
|
|
|
|
|
|
|
|
/*! \addtogroup HSA OCL Stub Implementation
|
|
|
|
|
* @{
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
//! HSA OCL STUB Implementation
|
|
|
|
|
namespace roc {
|
|
|
|
|
|
|
|
|
|
//! Device settings
|
2017-04-13 13:56:38 -04:00
|
|
|
class Settings : public device::Settings {
|
|
|
|
|
public:
|
|
|
|
|
union {
|
|
|
|
|
struct {
|
|
|
|
|
uint doublePrecision_ : 1; //!< Enables double precision support
|
|
|
|
|
uint enableLocalMemory_ : 1; //!< Enable GPUVM memory
|
2018-08-08 18:58:03 -04:00
|
|
|
uint enableCoarseGrainSVM_ : 1; //!< Enable device memory for coarse grain SVM allocations
|
2017-04-13 13:56:38 -04:00
|
|
|
uint enableNCMode_ : 1; //!< Enable Non Coherent mode for system memory
|
|
|
|
|
uint imageDMA_ : 1; //!< Enable direct image DMA transfers
|
|
|
|
|
uint stagedXferRead_ : 1; //!< Uses a staged buffer read
|
|
|
|
|
uint stagedXferWrite_ : 1; //!< Uses a staged buffer write
|
2018-11-01 17:49:35 -04:00
|
|
|
uint reserved_ : 25;
|
2016-07-21 12:41:26 -04:00
|
|
|
};
|
2017-04-13 13:56:38 -04:00
|
|
|
uint value_;
|
|
|
|
|
};
|
2016-07-21 12:41:26 -04:00
|
|
|
|
2017-04-13 13:56:38 -04:00
|
|
|
//! Default max workgroup size for 1D
|
|
|
|
|
int maxWorkGroupSize_;
|
2016-07-21 12:41:26 -04:00
|
|
|
|
2017-09-08 11:17:38 -04:00
|
|
|
//! Preferred workgroup size
|
|
|
|
|
uint preferredWorkGroupSize_;
|
|
|
|
|
|
2017-04-13 13:56:38 -04:00
|
|
|
//! Default max workgroup sizes for 2D
|
|
|
|
|
int maxWorkGroupSize2DX_;
|
|
|
|
|
int maxWorkGroupSize2DY_;
|
2016-07-21 12:41:26 -04:00
|
|
|
|
2017-04-13 13:56:38 -04:00
|
|
|
//! Default max workgroup sizes for 3D
|
|
|
|
|
int maxWorkGroupSize3DX_;
|
|
|
|
|
int maxWorkGroupSize3DY_;
|
|
|
|
|
int maxWorkGroupSize3DZ_;
|
2016-07-21 12:41:26 -04:00
|
|
|
|
2017-04-13 13:56:38 -04:00
|
|
|
uint kernargPoolSize_;
|
2018-06-12 16:17:29 -04:00
|
|
|
uint numDeviceEvents_; //!< The number of device events
|
|
|
|
|
uint numWaitEvents_; //!< The number of wait events for device enqueue
|
2016-07-21 12:41:26 -04:00
|
|
|
|
2017-04-13 13:56:38 -04:00
|
|
|
size_t xferBufSize_; //!< Transfer buffer size for image copy optimization
|
|
|
|
|
size_t stagedXferSize_; //!< Staged buffer size
|
|
|
|
|
size_t pinnedXferSize_; //!< Pinned buffer size for transfer
|
|
|
|
|
size_t pinnedMinXferSize_; //!< Minimal buffer size for pinned transfer
|
2017-01-23 11:59:51 -05:00
|
|
|
|
2017-04-13 13:56:38 -04:00
|
|
|
//! Default constructor
|
|
|
|
|
Settings();
|
2016-07-21 12:41:26 -04:00
|
|
|
|
2017-04-13 13:56:38 -04:00
|
|
|
//! Creates settings
|
|
|
|
|
bool create(bool fullProfile, int gfxipVersion);
|
2016-07-21 12:41:26 -04:00
|
|
|
|
2017-04-13 13:56:38 -04:00
|
|
|
private:
|
|
|
|
|
//! Disable copy constructor
|
|
|
|
|
Settings(const Settings&);
|
2016-07-21 12:41:26 -04:00
|
|
|
|
2017-04-13 13:56:38 -04:00
|
|
|
//! Disable assignment
|
|
|
|
|
Settings& operator=(const Settings&);
|
2016-07-21 12:41:26 -04:00
|
|
|
|
2017-04-13 13:56:38 -04:00
|
|
|
//! Overrides current settings based on registry/environment
|
|
|
|
|
void override();
|
2016-07-21 12:41:26 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/*@}*/} // namespace roc
|
|
|
|
|
|
|
|
|
|
#endif /*WITHOUT_HSA_BACKEND*/
|