From cb74d9528fb697cc28c8a450676e2505868c2f2a Mon Sep 17 00:00:00 2001
From: foreman
Date: Mon, 27 Jul 2015 16:42:49 -0400
Subject: [PATCH] P4 to Git Change 1174420 by gandryey@gera-dev-w7 on
2015/07/27 16:31:50
ECR #304775 - Merge cal.h, calcl.h and backend.h into backend.h and caltarget.h
Affected files ...
... //depot/stg/opencl/drivers/opencl/compiler/lib/api/v0_8/build/Makefile.apiv08#15 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/common/build/Makefile.common#32 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/gpu/scwrapper/build/Makefile.scwrapper#29 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/complibdefs#41 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/loaders/bif/amuabi/build/Makefile.amuabi#8 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/loaders/bif/bifinternal.hpp#10 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/loaders/bif/build/Makefile.bif#21 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/loaders/elf/elf.hpp#21 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/build/Makefile.gpu#65 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudefs.hpp#122 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/include/cal/cal.h#36 delete
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/include/cal/calcl.h#33 delete
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/EventQueue.h#6 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/GSLContext.h#47 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/GSLDevice.h#50 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/backend.h#5 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/build/Makefile.backend#7 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/caltarget.h#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/inifile/build/Makefile.inifile#2 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/inifile/inifile.cpp#2 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/inifile/inifile.h#2 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/inifile/inifile_parser.h#2 edit
... //depot/stg/opencl/drivers/opencl/runtime/runtimedefs#34 edit
... //depot/stg/opencl/drivers/opencl/tests/ocltst/module/binary/build/Makefile.binary#18 edit
... //depot/stg/opencl/drivers/opencl/tests/ocltst/module/complib/build/Makefile.complib#36 edit
---
rocclr/compiler/lib/complibdefs | 4 +-
rocclr/compiler/lib/loaders/elf/elf.hpp | 2 +-
rocclr/runtime/device/gpu/gpudefs.hpp | 2 -
.../device/gpu/gslbe/src/include/cal/cal.h | 310 ------------------
.../device/gpu/gslbe/src/include/cal/calcl.h | 201 ------------
.../device/gpu/gslbe/src/rt/EventQueue.h | 1 -
.../device/gpu/gslbe/src/rt/GSLContext.h | 3 +-
.../device/gpu/gslbe/src/rt/GSLDevice.h | 3 +-
.../runtime/device/gpu/gslbe/src/rt/backend.h | 248 +++++++++++++-
.../device/gpu/gslbe/src/rt/caltarget.h | 51 +++
.../gpu/gslbe/src/rt/inifile/inifile.cpp | 1 -
.../device/gpu/gslbe/src/rt/inifile/inifile.h | 2 +-
.../gpu/gslbe/src/rt/inifile/inifile_parser.h | 1 -
13 files changed, 292 insertions(+), 537 deletions(-)
delete mode 100644 rocclr/runtime/device/gpu/gslbe/src/include/cal/cal.h
delete mode 100644 rocclr/runtime/device/gpu/gslbe/src/include/cal/calcl.h
create mode 100644 rocclr/runtime/device/gpu/gslbe/src/rt/caltarget.h
diff --git a/rocclr/compiler/lib/complibdefs b/rocclr/compiler/lib/complibdefs
index eb51c11516..3afa878fe2 100644
--- a/rocclr/compiler/lib/complibdefs
+++ b/rocclr/compiler/lib/complibdefs
@@ -56,9 +56,7 @@ GCPPFLAGS += $(DEFSWITCH) "BREAK_ON_LOG_WARNING=0"
GCPPFLAGS += $(DEFSWITCH) "BREAK_ON_LOG_ERROR=0"
GCPPFLAGS += $(DEFSWITCH) "LOG_LEVEL=2"
-export CAL_INCLUDES = $(OPENCL_DEPTH)/runtime/device/gpu/gslbe/src/include/cal
-GCPPFLAGS += $(INCSWITCH) "$(CAL_INCLUDES)"
-GCPPFLAGS += $(INCSWITCH) "$(CAL_INCLUDES)/private"
+GCPPFLAGS += $(INCSWITCH) "$(OPENCL_DEPTH)/runtime/device/gpu/gslbe/src/rt"
GCPPFLAGS += $(INCSWITCH) "$(UGL_DEPTH)/gl/gs/hwl/pele/include/asic"
GCPPFLAGS += $(INCSWITCH) "$(UGL_DEPTH)/gl/gs/hwl/evergreen/include/asic"
GCPPFLAGS += $(INCSWITCH) "$(UGL_DEPTH)/gl/gs/hwl/si/include/asic"
diff --git a/rocclr/compiler/lib/loaders/elf/elf.hpp b/rocclr/compiler/lib/loaders/elf/elf.hpp
index 34bf608595..03b92f19cf 100644
--- a/rocclr/compiler/lib/loaders/elf/elf.hpp
+++ b/rocclr/compiler/lib/loaders/elf/elf.hpp
@@ -8,7 +8,7 @@
#include "top.hpp"
#include "elf_utils.hpp"
-#include "cal.h" // using CALtargetEnum
+#include "caltarget.h" // using CALtargetEnum
#include "libelf.h"
#include "gelf.h"
diff --git a/rocclr/runtime/device/gpu/gpudefs.hpp b/rocclr/runtime/device/gpu/gpudefs.hpp
index d9e8e18b6c..d919caf182 100644
--- a/rocclr/runtime/device/gpu/gpudefs.hpp
+++ b/rocclr/runtime/device/gpu/gpudefs.hpp
@@ -6,8 +6,6 @@
#include "top.hpp"
-#include "cal.h"
-#include "calcl.h"
#include "gsl_types.h"
#include "gsl_config.h"
#include "gsl_vid_if.h"
diff --git a/rocclr/runtime/device/gpu/gslbe/src/include/cal/cal.h b/rocclr/runtime/device/gpu/gslbe/src/include/cal/cal.h
deleted file mode 100644
index 149b4fbf5f..0000000000
--- a/rocclr/runtime/device/gpu/gslbe/src/include/cal/cal.h
+++ /dev/null
@@ -1,310 +0,0 @@
-/**
- * @file cal.h
- * @brief CAL Interface Header
- * @version 1.00.0 Beta
- */
-
-
-/* ============================================================
-
-Copyright (c) 2007 Advanced Micro Devices, Inc. All rights reserved.
-
-Redistribution and use of this material is permitted under the following
-conditions:
-
-Redistributions must retain the above copyright notice and all terms of this
-license.
-
-In no event shall anyone redistributing or accessing or using this material
-commence or participate in any arbitration or legal action relating to this
-material against Advanced Micro Devices, Inc. or any copyright holders or
-contributors. The foregoing shall survive any expiration or termination of
-this license or any agreement or access or use related to this material.
-
-ANY BREACH OF ANY TERM OF THIS LICENSE SHALL RESULT IN THE IMMEDIATE REVOCATION
-OF ALL RIGHTS TO REDISTRIBUTE, ACCESS OR USE THIS MATERIAL.
-
-THIS MATERIAL IS PROVIDED BY ADVANCED MICRO DEVICES, INC. AND ANY COPYRIGHT
-HOLDERS AND CONTRIBUTORS "AS IS" IN ITS CURRENT CONDITION AND WITHOUT ANY
-REPRESENTATIONS, GUARANTEE, OR WARRANTY OF ANY KIND OR IN ANY WAY RELATED TO
-SUPPORT, INDEMNITY, ERROR FREE OR UNINTERRUPTED OPERATION, OR THAT IT IS FREE
-FROM DEFECTS OR VIRUSES. ALL OBLIGATIONS ARE HEREBY DISCLAIMED - WHETHER
-EXPRESS, IMPLIED, OR STATUTORY - INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED
-WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
-ACCURACY, COMPLETENESS, OPERABILITY, QUALITY OF SERVICE, OR NON-INFRINGEMENT.
-IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. OR ANY COPYRIGHT HOLDERS OR
-CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, PUNITIVE,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
-OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, REVENUE, DATA, OR PROFITS; OR
-BUSINESS INTERRUPTION) HOWEVER CAUSED OR BASED ON ANY THEORY OF LIABILITY
-ARISING IN ANY WAY RELATED TO THIS MATERIAL, EVEN IF ADVISED OF THE POSSIBILITY
-OF SUCH DAMAGE. THE ENTIRE AND AGGREGATE LIABILITY OF ADVANCED MICRO DEVICES,
-INC. AND ANY COPYRIGHT HOLDERS AND CONTRIBUTORS SHALL NOT EXCEED TEN DOLLARS
-(US $10.00). ANYONE REDISTRIBUTING OR ACCESSING OR USING THIS MATERIAL ACCEPTS
-THIS ALLOCATION OF RISK AND AGREES TO RELEASE ADVANCED MICRO DEVICES, INC. AND
-ANY COPYRIGHT HOLDERS AND CONTRIBUTORS FROM ANY AND ALL LIABILITIES,
-OBLIGATIONS, CLAIMS, OR DEMANDS IN EXCESS OF TEN DOLLARS (US $10.00). THE
-FOREGOING ARE ESSENTIAL TERMS OF THIS LICENSE AND, IF ANY OF THESE TERMS ARE
-CONSTRUED AS UNENFORCEABLE, FAIL IN ESSENTIAL PURPOSE, OR BECOME VOID OR
-DETRIMENTAL TO ADVANCED MICRO DEVICES, INC. OR ANY COPYRIGHT HOLDERS OR
-CONTRIBUTORS FOR ANY REASON, THEN ALL RIGHTS TO REDISTRIBUTE, ACCESS OR USE
-THIS MATERIAL SHALL TERMINATE IMMEDIATELY. MOREOVER, THE FOREGOING SHALL
-SURVIVE ANY EXPIRATION OR TERMINATION OF THIS LICENSE OR ANY AGREEMENT OR
-ACCESS OR USE RELATED TO THIS MATERIAL.
-
-NOTICE IS HEREBY PROVIDED, AND BY REDISTRIBUTING OR ACCESSING OR USING THIS
-MATERIAL SUCH NOTICE IS ACKNOWLEDGED, THAT THIS MATERIAL MAY BE SUBJECT TO
-RESTRICTIONS UNDER THE LAWS AND REGULATIONS OF THE UNITED STATES OR OTHER
-COUNTRIES, WHICH INCLUDE BUT ARE NOT LIMITED TO, U.S. EXPORT CONTROL LAWS SUCH
-AS THE EXPORT ADMINISTRATION REGULATIONS AND NATIONAL SECURITY CONTROLS AS
-DEFINED THEREUNDER, AS WELL AS STATE DEPARTMENT CONTROLS UNDER THE U.S.
-MUNITIONS LIST. THIS MATERIAL MAY NOT BE USED, RELEASED, TRANSFERRED, IMPORTED,
-EXPORTED AND/OR RE-EXPORTED IN ANY MANNER PROHIBITED UNDER ANY APPLICABLE LAWS,
-INCLUDING U.S. EXPORT CONTROL LAWS REGARDING SPECIFICALLY DESIGNATED PERSONS,
-COUNTRIES AND NATIONALS OF COUNTRIES SUBJECT TO NATIONAL SECURITY CONTROLS.
-MOREOVER, THE FOREGOING SHALL SURVIVE ANY EXPIRATION OR TERMINATION OF ANY
-LICENSE OR AGREEMENT OR ACCESS OR USE RELATED TO THIS MATERIAL.
-
-NOTICE REGARDING THE U.S. GOVERNMENT AND DOD AGENCIES: This material is
-provided with "RESTRICTED RIGHTS" and/or "LIMITED RIGHTS" as applicable to
-computer software and technical data, respectively. Use, duplication,
-distribution or disclosure by the U.S. Government and/or DOD agencies is
-subject to the full extent of restrictions in all applicable regulations,
-including those found at FAR52.227 and DFARS252.227 et seq. and any successor
-regulations thereof. Use of this material by the U.S. Government and/or DOD
-agencies is acknowledgment of the proprietary rights of any copyright holders
-and contributors, including those of Advanced Micro Devices, Inc., as well as
-the provisions of FAR52.227-14 through 23 regarding privately developed and/or
-commercial computer software.
-
-This license forms the entire agreement regarding the subject matter hereof and
-supersedes all proposals and prior discussions and writings between the parties
-with respect thereto. This license does not affect any ownership, rights, title,
-or interest in, or relating to, this material. No terms of this license can be
-modified or waived, and no breach of this license can be excused, unless done
-so in a writing signed by all affected parties. Each term of this license is
-separately enforceable. If any term of this license is determined to be or
-becomes unenforceable or illegal, such term shall be reformed to the minimum
-extent necessary in order for this license to remain in effect in accordance
-with its terms as modified by such reformation. This license shall be governed
-by and construed in accordance with the laws of the State of Texas without
-regard to rules on conflicts of law of any state or jurisdiction or the United
-Nations Convention on the International Sale of Goods. All disputes arising out
-of this license shall be subject to the jurisdiction of the federal and state
-courts in Austin, Texas, and all defenses are hereby waived concerning personal
-jurisdiction and venue of these courts.
-
-============================================================ */
-
-#ifndef __CAL_H__
-#define __CAL_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef void CALvoid; /**< void type */
-typedef char CALchar; /**< ASCII character */
-typedef signed char CALbyte; /**< 1 byte signed integer value */
-typedef unsigned char CALubyte; /**< 1 byte unsigned integer value */
-typedef signed short CALshort; /**< 2 byte signed integer value */
-typedef unsigned short CALushort; /**< 2 byte unsigned integer value */
-typedef signed int CALint; /**< 4 byte signed integer value */
-typedef unsigned int CALuint; /**< 4 byte unsigned intger value */
-typedef float CALfloat; /**< 32-bit IEEE floating point value */
-typedef double CALdouble; /**< 64-bit IEEE floating point value */
-typedef signed long CALlong; /**< long value */
-typedef unsigned long CALulong; /**< unsigned long value */
-
-#if defined(_MSC_VER)
-
-typedef signed __int64 CALint64; /**< 8 byte signed integer value */
-typedef unsigned __int64 CALuint64; /**< 8 byte unsigned integer value */
-
-#elif defined(__GNUC__)
-
-typedef signed long long CALint64; /**< 8 byte signed integer value */
-typedef unsigned long long CALuint64; /**< 8 byte unsigned integer value */
-
-#else
-#error "Unsupported compiler type."
-#endif
-
-/** Boolean type */
-typedef enum CALbooleanEnum {
- CAL_FALSE = 0, /**< Boolean false value */
- CAL_TRUE = 1 /**< Boolean true value */
-} CALboolean;
-
-/** Device Kernel ISA */
-typedef enum CALtargetEnum {
- CAL_TARGET_600, /**< R600 GPU ISA */
- CAL_TARGET_610, /**< RV610 GPU ISA */
- CAL_TARGET_630, /**< RV630 GPU ISA */
- CAL_TARGET_670, /**< RV670 GPU ISA */
- CAL_TARGET_7XX, /**< R700 class GPU ISA */
- CAL_TARGET_770, /**< RV770 GPU ISA */
- CAL_TARGET_710, /**< RV710 GPU ISA */
- CAL_TARGET_730, /**< RV730 GPU ISA */
- CAL_TARGET_CYPRESS, /**< CYPRESS GPU ISA */
- CAL_TARGET_JUNIPER, /**< JUNIPER GPU ISA */
- CAL_TARGET_REDWOOD, /**< REDWOOD GPU ISA */
- CAL_TARGET_CEDAR, /**< CEDAR GPU ISA */
-//##BEGIN_PRIVATE##
- CAL_TARGET_SUMO, /**< SUMO GPU ISA */
- CAL_TARGET_SUPERSUMO, /**< SUPERSUMO GPU ISA */
- CAL_TARGET_WRESTLER, /**< WRESTLER GPU ISA */
- CAL_TARGET_CAYMAN, /**< CAYMAN GPU ISA */
- CAL_TARGET_KAUAI, /**< KAUAI GPU ISA */
- CAL_TARGET_BARTS , /**< BARTS GPU ISA */
- CAL_TARGET_TURKS , /**< TURKS GPU ISA */
- CAL_TARGET_CAICOS, /**< CAICOS GPU ISA */
- CAL_TARGET_TAHITI, /**< TAHITI GPU ISA*/
- CAL_TARGET_PITCAIRN, /**< PITCAIRN GPU ISA*/
- CAL_TARGET_CAPEVERDE, /**< CAPE VERDE GPU ISA*/
- CAL_TARGET_DEVASTATOR, /**< DEVASTATOR GPU ISA*/
- CAL_TARGET_SCRAPPER, /**< SCRAPPER GPU ISA*/
- CAL_TARGET_OLAND, /**< OLAND GPU ISA*/
- CAL_TARGET_BONAIRE, /**< BONAIRE GPU ISA*/
- CAL_TARGET_SPECTRE, /**< KAVERI1 GPU ISA*/
- CAL_TARGET_SPOOKY, /**< KAVERI2 GPU ISA*/
- CAL_TARGET_KALINDI, /**< KALINDI GPU ISA*/
- CAL_TARGET_HAINAN, /**< HAINAN GPU ISA*/
- CAL_TARGET_HAWAII, /**< HAWAII GPU ISA*/
- CAL_TARGET_ICELAND, /**< ICELAND GPU ISA*/
- CAL_TARGET_TONGA, /**< TONGA GPU ISA*/
- CAL_TARGET_GODAVARI, /**< MULLINS GPU ISA*/
- CAL_TARGET_FIJI, /**< FIJI GPU ISA*/
- CAL_TARGET_CARRIZO, /**< CARRIZO GPU ISA*/
- CAL_TARGET_ELLESMERE, /**< ELLESMERE GPU ISA*/
- CAL_TARGET_BAFFIN, /**< BAFFIN GPU ISA*/
- CAL_TARGET_GREENLAND, /**< GREENLAND GPU ISA*/
- CAL_TARGET_LAST = CAL_TARGET_GREENLAND, /**< last */
-//##END_PRIVATE##
-} CALtarget;
-
-/** CAL image container */
-typedef struct CALimageRec* CALimage;
-
-#define CAL_ASIC_INFO_MAX_LEN 128
-
-/** CAL computational domain */
-typedef struct CALdomainRec {
- CALuint x; /**< x origin of domain */
- CALuint y; /**< y origin of domain */
- CALuint width; /**< width of domain */
- CALuint height; /**< height of domain */
-} CALdomain;
-
-/** CAL device attributes */
-typedef struct CALdeviceattribsRec {
- CALuint struct_size; /**< Client filled out size of CALdeviceattribs struct */
- CALtarget target; /**< Asic identifier */
- CALuint localRAM; /**< Amount of local GPU RAM in megabytes */
- CALuint uncachedRemoteRAM; /**< Amount of uncached remote GPU memory in megabytes */
- CALuint cachedRemoteRAM; /**< Amount of cached remote GPU memory in megabytes */
- CALuint engineClock; /**< GPU device clock rate in megahertz */
- CALuint memoryClock; /**< GPU memory clock rate in megahertz */
- CALuint wavefrontSize; /**< Wavefront size */
- CALuint numberOfSIMD; /**< Number of SIMDs */
- CALuint numberOfCUsperShaderArray; /**< Number of CUs per shader array */
- bool doublePrecision; /**< double precision supported */
- bool localDataShare; /**< local data share supported */
- bool globalDataShare; /**< global data share supported */
- bool globalGPR; /**< global GPR supported */
- bool computeShader; /**< compute shader supported */
- bool memExport; /**< memexport supported */
- CALuint pitch_alignment; /**< Required alignment for calCreateRes allocations (in data elements) */
- CALuint surface_alignment; /**< Required start address alignment for calCreateRes allocations (in bytes) */
- CALuint numberOfUAVs; /**< Number of UAVs */
- bool bUAVMemExport; /**< Hw only supports mem export to simulate 1 UAV */
- CALuint numberOfShaderEngines; /**< Number of shader engines */
- CALuint targetRevision; /**< Asic family revision */
- CALuint totalVisibleHeap; /**< Amount of visible local GPU RAM in megabytes */
- CALuint totalInvisibleHeap; /**< Amount of invisible local GPU RAM in megabytes */
- CALuint totalDirectHeap; /**< Amount of direct GPU memory in megabytes */
- CALuint totalCoherentHeap; /**< Amount of coherent GPU memory in megabytes */
- CALuint totalRemoteSharedHeap; /**< Amount of remote Shared GPU memory in megabytes */
- CALuint totalCachedRemoteSharedHeap; /**< Amount of cached remote Shared GPU memory in megabytes */
- CALuint totalSDIHeap; /**< Amount of SDI memory allocated in CCC */
- CALuint pciTopologyInformation; /**< PCI topology information contains: bus, device and function number. */
- CALchar boardName[CAL_ASIC_INFO_MAX_LEN]; /**< Actual ASIC board name and not the internal name. */
- bool vectorBufferInstructionAddr64; /**< Vector buffer instructions support ADDR64 mode */
- bool memRandomAccessTargetInstructions; /**< hw/sc supports memory RAT (Random Access Target) instructions e.g. mem0.x_z_ supported */
- CALuint memBusWidth; /**< Memory busw width */
- CALuint numMemBanks; /**< Number of memory banks */
- CALuint counterFreq; /**< Ref clock counter frequency */
- double nanoSecondsPerTick; /**< Nano seconds per GPU tick */
- bool longIdleDetect; /**< Whether LongIdleDetect enabled */
- bool svmAtomics; /**< check if svm atomics support */
- CALuint64 vaStart; /**< VA start address */
- CALuint64 vaEnd; /**< VA end address */
- bool isWorkstation; /**< Whether Device is a Workstation/Server part */
- CALuint numOfVpu; /**< number of vpu in the device*/
- bool isOpenCL200Device; /**< the flag to mark if the device is OpenCL 200 */
- bool isSVMFineGrainSystem; /**< check if SVM finegrainsystem */
-} CALdeviceattribs;
-
-/** CAL device status */
-typedef struct CALdevicestatusRec {
- CALuint struct_size; /**< Client filled out size of CALdevicestatus struct */
- CALuint availLocalRAM; /**< Amount of available local GPU RAM in megabytes */
- CALuint availUncachedRemoteRAM; /**< Amount of available uncached remote GPU memory in megabytes */
- CALuint availCachedRemoteRAM; /**< Amount of available cached remote GPU memory in megabytes */
- CALuint availVisibleHeap; /**< Amount of available visible local GPU RAM in megabytes */
- CALuint availInvisibleHeap; /**< Amount of available invisible local GPU RAM in megabytes */
- CALuint availDirectHeap; /**< Amount of available direct GPU memory in megabytes */
- CALuint availCoherentHeap; /**< Amount of available coherent GPU memory in megabytes */
- CALuint availRemoteSharedHeap; /**< Amount of available remote Shared GPU memory in megabytes */
- CALuint availCachedRemoteSharedHeap; /**< Amount of available cached remote Shared GPU memory in megabytes */
- CALuint largestBlockVisibleHeap; /**< Largest block available visible local GPU RAM in megabytes */
- CALuint largestBlockInvisibleHeap; /**< Largest block available invisible local GPU RAM in megabytes */
- CALuint largestBlockRemoteHeap; /**< Largest block available remote GPU memory in megabytes */
- CALuint largestBlockCachedRemoteHeap; /**< Largest block available cached remote GPU memory in megabytes */
- CALuint largestBlockDirectHeap; /**< Largest block available direct GPU memory in megabytes */
- CALuint largestBlockCoherentHeap; /**< Largest block available coherent GPU memory in megabytes */
- CALuint largestBlockRemoteSharedHeap; /**< Largest block available remote Shared GPU memory in megabytes */
- CALuint largestBlockCachedRemoteSharedHeap; /**< Largest block available cached remote Shared GPU memory in megabytes */
-} CALdevicestatus;
-
-/** CAL resource allocation flags **/
-typedef enum CALresallocflagsEnum {
- CAL_RESALLOC_GLOBAL_BUFFER = 1, /**< used for global import/export buffer */
-} CALresallocflags;
-
-
-/** CAL function information **/
-typedef struct CALfuncInfoRec
-{
- CALuint maxScratchRegsNeeded; /**< Maximum number of scratch regs needed */
- CALuint numSharedGPRUser; /**< Number of shared GPRs */
- CALuint numSharedGPRTotal; /**< Number of shared GPRs including ones used by SC */
- bool eCsSetupMode; /**< Slow mode */
- CALuint numThreadPerGroup; /**< Flattend umber of threads per group */
- CALuint numThreadPerGroupX; /**< x dimension of numThreadPerGroup */
- CALuint numThreadPerGroupY; /**< y dimension of numThreadPerGroup */
- CALuint numThreadPerGroupZ; /**< z dimension of numThreadPerGroup */
- CALuint totalNumThreadGroup; /**< Total number of thread groups */
- CALuint numWavefrontPerSIMD; /**< Number of wavefronts per SIMD */
- bool isMaxNumWavePerSIMD; /**< Is this the max num active wavefronts per SIMD */
- bool setBufferForNumGroup; /**< Need to set up buffer for info on number of thread groups? */
- CALuint wavefrontSize; /**< number of threads per wavefront. */
- CALuint numGPRsAvailable; /**< number of GPRs available to the program */
- CALuint numGPRsUsed; /**< number of GPRs used by the program */
- CALuint LDSSizeAvailable; /**< LDS size available to the program */
- CALuint LDSSizeUsed; /**< LDS size used by the program */
- CALuint stackSizeAvailable; /**< stack size availabe to the program */
- CALuint stackSizeUsed; /**< stack size use by the program */
- CALuint numSGPRsAvailable; /**< number of SGPRs available to the program */
- CALuint numSGPRsUsed; /**< number of SGPRs used by the program */
- CALuint numVGPRsAvailable; /**< number of VGPRs available to the program */
- CALuint numVGPRsUsed; /**< number of VGPRs used by the program */
-} CALfuncInfo;
-
-#ifdef __cplusplus
-} /* extern "C" { */
-#endif
-
-
-#endif /* __CAL_H__ */
-
diff --git a/rocclr/runtime/device/gpu/gslbe/src/include/cal/calcl.h b/rocclr/runtime/device/gpu/gslbe/src/include/cal/calcl.h
deleted file mode 100644
index d7829454b8..0000000000
--- a/rocclr/runtime/device/gpu/gslbe/src/include/cal/calcl.h
+++ /dev/null
@@ -1,201 +0,0 @@
-/**
- * @file calcl.h
- * @brief CAL Compiler Interface Header
- * @version 1.00.0 Beta
- */
-
-
-/* ============================================================
-
-Copyright (c) 2007 Advanced Micro Devices, Inc. All rights reserved.
-
-Redistribution and use of this material is permitted under the following
-conditions:
-
-Redistributions must retain the above copyright notice and all terms of this
-license.
-
-In no event shall anyone redistributing or accessing or using this material
-commence or participate in any arbitration or legal action relating to this
-material against Advanced Micro Devices, Inc. or any copyright holders or
-contributors. The foregoing shall survive any expiration or termination of
-this license or any agreement or access or use related to this material.
-
-ANY BREACH OF ANY TERM OF THIS LICENSE SHALL RESULT IN THE IMMEDIATE REVOCATION
-OF ALL RIGHTS TO REDISTRIBUTE, ACCESS OR USE THIS MATERIAL.
-
-THIS MATERIAL IS PROVIDED BY ADVANCED MICRO DEVICES, INC. AND ANY COPYRIGHT
-HOLDERS AND CONTRIBUTORS "AS IS" IN ITS CURRENT CONDITION AND WITHOUT ANY
-REPRESENTATIONS, GUARANTEE, OR WARRANTY OF ANY KIND OR IN ANY WAY RELATED TO
-SUPPORT, INDEMNITY, ERROR FREE OR UNINTERRUPTED OPERATION, OR THAT IT IS FREE
-FROM DEFECTS OR VIRUSES. ALL OBLIGATIONS ARE HEREBY DISCLAIMED - WHETHER
-EXPRESS, IMPLIED, OR STATUTORY - INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED
-WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
-ACCURACY, COMPLETENESS, OPERABILITY, QUALITY OF SERVICE, OR NON-INFRINGEMENT.
-IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. OR ANY COPYRIGHT HOLDERS OR
-CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, PUNITIVE,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
-OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, REVENUE, DATA, OR PROFITS; OR
-BUSINESS INTERRUPTION) HOWEVER CAUSED OR BASED ON ANY THEORY OF LIABILITY
-ARISING IN ANY WAY RELATED TO THIS MATERIAL, EVEN IF ADVISED OF THE POSSIBILITY
-OF SUCH DAMAGE. THE ENTIRE AND AGGREGATE LIABILITY OF ADVANCED MICRO DEVICES,
-INC. AND ANY COPYRIGHT HOLDERS AND CONTRIBUTORS SHALL NOT EXCEED TEN DOLLARS
-(US $10.00). ANYONE REDISTRIBUTING OR ACCESSING OR USING THIS MATERIAL ACCEPTS
-THIS ALLOCATION OF RISK AND AGREES TO RELEASE ADVANCED MICRO DEVICES, INC. AND
-ANY COPYRIGHT HOLDERS AND CONTRIBUTORS FROM ANY AND ALL LIABILITIES,
-OBLIGATIONS, CLAIMS, OR DEMANDS IN EXCESS OF TEN DOLLARS (US $10.00). THE
-FOREGOING ARE ESSENTIAL TERMS OF THIS LICENSE AND, IF ANY OF THESE TERMS ARE
-CONSTRUED AS UNENFORCEABLE, FAIL IN ESSENTIAL PURPOSE, OR BECOME VOID OR
-DETRIMENTAL TO ADVANCED MICRO DEVICES, INC. OR ANY COPYRIGHT HOLDERS OR
-CONTRIBUTORS FOR ANY REASON, THEN ALL RIGHTS TO REDISTRIBUTE, ACCESS OR USE
-THIS MATERIAL SHALL TERMINATE IMMEDIATELY. MOREOVER, THE FOREGOING SHALL
-SURVIVE ANY EXPIRATION OR TERMINATION OF THIS LICENSE OR ANY AGREEMENT OR
-ACCESS OR USE RELATED TO THIS MATERIAL.
-
-NOTICE IS HEREBY PROVIDED, AND BY REDISTRIBUTING OR ACCESSING OR USING THIS
-MATERIAL SUCH NOTICE IS ACKNOWLEDGED, THAT THIS MATERIAL MAY BE SUBJECT TO
-RESTRICTIONS UNDER THE LAWS AND REGULATIONS OF THE UNITED STATES OR OTHER
-COUNTRIES, WHICH INCLUDE BUT ARE NOT LIMITED TO, U.S. EXPORT CONTROL LAWS SUCH
-AS THE EXPORT ADMINISTRATION REGULATIONS AND NATIONAL SECURITY CONTROLS AS
-DEFINED THEREUNDER, AS WELL AS STATE DEPARTMENT CONTROLS UNDER THE U.S.
-MUNITIONS LIST. THIS MATERIAL MAY NOT BE USED, RELEASED, TRANSFERRED, IMPORTED,
-EXPORTED AND/OR RE-EXPORTED IN ANY MANNER PROHIBITED UNDER ANY APPLICABLE LAWS,
-INCLUDING U.S. EXPORT CONTROL LAWS REGARDING SPECIFICALLY DESIGNATED PERSONS,
-COUNTRIES AND NATIONALS OF COUNTRIES SUBJECT TO NATIONAL SECURITY CONTROLS.
-MOREOVER, THE FOREGOING SHALL SURVIVE ANY EXPIRATION OR TERMINATION OF ANY
-LICENSE OR AGREEMENT OR ACCESS OR USE RELATED TO THIS MATERIAL.
-
-NOTICE REGARDING THE U.S. GOVERNMENT AND DOD AGENCIES: This material is
-provided with "RESTRICTED RIGHTS" and/or "LIMITED RIGHTS" as applicable to
-computer software and technical data, respectively. Use, duplication,
-distribution or disclosure by the U.S. Government and/or DOD agencies is
-subject to the full extent of restrictions in all applicable regulations,
-including those found at FAR52.227 and DFARS252.227 et seq. and any successor
-regulations thereof. Use of this material by the U.S. Government and/or DOD
-agencies is acknowledgment of the proprietary rights of any copyright holders
-and contributors, including those of Advanced Micro Devices, Inc., as well as
-the provisions of FAR52.227-14 through 23 regarding privately developed and/or
-commercial computer software.
-
-This license forms the entire agreement regarding the subject matter hereof and
-supersedes all proposals and prior discussions and writings between the parties
-with respect thereto. This license does not affect any ownership, rights, title,
-or interest in, or relating to, this material. No terms of this license can be
-modified or waived, and no breach of this license can be excused, unless done
-so in a writing signed by all affected parties. Each term of this license is
-separately enforceable. If any term of this license is determined to be or
-becomes unenforceable or illegal, such term shall be reformed to the minimum
-extent necessary in order for this license to remain in effect in accordance
-with its terms as modified by such reformation. This license shall be governed
-by and construed in accordance with the laws of the State of Texas without
-regard to rules on conflicts of law of any state or jurisdiction or the United
-Nations Convention on the International Sale of Goods. All disputes arising out
-of this license shall be subject to the jurisdiction of the federal and state
-courts in Austin, Texas, and all defenses are hereby waived concerning personal
-jurisdiction and venue of these courts.
-
-============================================================ */
-
-#ifndef __CALCL_H__
-#define __CALCL_H__
-
-#include "cal.h"
-#include "gsl_enum.h"
-#include "gsl_types.h"
-#include "cm_enum.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct ProgramGridRec
-{
- gslDomain3D gridBlock; /**< size of a block of data */
- gslDomain3D gridSize; /**< size of 'blocks' to execute. */
- gslDomain3D partialGridBlock;/** Partial grid block */
- CALuint localSize; /** size of OpenCL Local Memory in bytes */
-} ProgramGrid;
-
-// flags for calCtxWaitForEvents
-typedef enum CALwaitTypeEnum
-{
- CAL_WAIT_POLLING = 0,
- CAL_WAIT_LOW_CPU_UTILIZATION = 1,
-} CALwaitType;
-
-//
-// calResAllocView typedefs
-//
-typedef enum CALresallocviewflagsRec {
- CAL_RESALLOCVIEW_GLOBAL_BUFFER = CAL_RESALLOC_GLOBAL_BUFFER, /**< used for global import/export buffer */
- CAL_RESALLOCVIEW_LINEAR_ALIGNED = CAL_RESALLOC_GLOBAL_BUFFER, /**< 256 byte alignment restriction. */
- CAL_RESALLOCVIEW_LINEAR_UNALIGNED = 3, /**< no alignment restrictions */
-} CALresallocviewflags;
-
-typedef struct CALresourceDescRec {
- gslMemObjectAttribLocation type;
- gslResource3D size;
- cmSurfFmt format;
- gslChannelOrder channelOrder;
- gslMemObjectAttribType dimension;
- CALuint mipLevels;
- CALvoid* systemMemory;
- CALuint flags;
- CALuint systemMemorySize;
- CALuint64 busAddress[2];
- mcaddr vaBase;
- gslMemObjectAttribSection section;
- CALuint minAlignment;
- bool isAllocExecute;
-} CALresourceDesc;
-
-typedef enum CALresallocsliceviewflagsRec {
- CAL_RESALLOCSLICEVIEW_GLOBAL_BUFFER = CAL_RESALLOC_GLOBAL_BUFFER, /**< used for global import/export buffer */
- CAL_RESALLOCSLICEVIEW_LINEAR_ALIGNED = CAL_RESALLOC_GLOBAL_BUFFER, /**< 256 byte alignment restriction. */
- CAL_RESALLOCSLICEVIEW_LINEAR_UNALIGNED = CAL_RESALLOCVIEW_LINEAR_UNALIGNED, /**< no alignment restrictions */
- CAL_RESALLOCSLICEVIEW_LEVEL = 0x10, /**< sliceDesc.layer is not used, the whole level is only*/
- CAL_RESALLOCSLICEVIEW_LAYER = 0x20, /**< sliceDesc.layer is not used, the whole level is only*/
- CAL_RESALLOCSLICEVIEW_LEVEL_AND_LAYER = CAL_RESALLOCSLICEVIEW_LEVEL | CAL_RESALLOCSLICEVIEW_LAYER,
-} CALresallocsliceviewflags;
-
-//
-// Thread Trace Extension
-//
-
-typedef struct CALthreadTraceConfigRec CALthreadTraceConfig;
-
-struct CALthreadTraceConfigRec
-{
- CALuint cu; // target compute unit [cu]
- CALuint sh; // target shader array [sh],that contains target cu
- CALuint simd_mask; // bitmask to enable or disable target tokens for different SIMDs
- CALuint vm_id_mask; // virtual memory [vm] IDs to capture
- CALuint token_mask; // bitmask indicating which trace token IDs will be included in the trace
- CALuint reg_mask; // bitmask indicating which register types should be included in the trace
- CALuint inst_mask; // types of instruction scheduling updates which should be recorded
- CALuint random_seed; // linear feedback shift register [LFSR] seed
- CALuint user_data; // user data ,which is written as payload
- CALuint capture_mode; // indicator for the way how THREAD_TRACE_START / STOP events affect token collection
- CALboolean is_user_data; // indicator if user_data is set
- CALboolean is_wrapped; // indicator if the memory buffer should be wrapped around instead of stopping at the end
-};
-
-typedef enum CALmemcopyflagsEnum
-{
- CAL_MEMCOPY_DEFAULT = 0, /**< default CAL behavior of partial sync */
- CAL_MEMCOPY_SYNC = 1, /**< used to synchronize with the specified CAL context */
- CAL_MEMCOPY_ASYNC = 2, /**< used to indicate completely asynchronous behavior */
-} CALmemcopyflags;
-
-typedef struct CALDeviceGLParamsRec {
- CALvoid *GLplatformContext;
- CALvoid *GLdeviceContext;
- CALuint flags;
-} CALDeviceGLParams;
-
-#ifdef __cplusplus
-} /* extern "C" { */
-#endif
-
-
-#endif /* __CALCL_H__ */
diff --git a/rocclr/runtime/device/gpu/gslbe/src/rt/EventQueue.h b/rocclr/runtime/device/gpu/gslbe/src/rt/EventQueue.h
index a535fb3671..fc49a8e4f4 100644
--- a/rocclr/runtime/device/gpu/gslbe/src/rt/EventQueue.h
+++ b/rocclr/runtime/device/gpu/gslbe/src/rt/EventQueue.h
@@ -1,7 +1,6 @@
#ifndef __EventQueue_h__
#define __EventQueue_h__
-#include "cal.h"
#include "backend.h"
#include "atitypes.h"
#include "gsl_types.h"
diff --git a/rocclr/runtime/device/gpu/gslbe/src/rt/GSLContext.h b/rocclr/runtime/device/gpu/gslbe/src/rt/GSLContext.h
index 7fd5a25dae..052a520520 100644
--- a/rocclr/runtime/device/gpu/gslbe/src/rt/GSLContext.h
+++ b/rocclr/runtime/device/gpu/gslbe/src/rt/GSLContext.h
@@ -4,8 +4,7 @@
#include "atitypes.h"
#include "gsl_types.h"
#include "gsl_vid_if.h"
-#include "cal.h"
-#include "calcl.h"
+#include "backend.h"
#include "EventQueue.h"
#include "amuABI.h"
diff --git a/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.h b/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.h
index 06044daa34..654e74a6a2 100644
--- a/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.h
+++ b/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.h
@@ -1,8 +1,7 @@
#ifndef __GSLDevice_h__
#define __GSLDevice_h__
-#include "cal.h"
-#include "calcl.h"
+#include "backend.h"
#include "atitypes.h"
#include "gsl_types.h"
#include "gsl_config.h"
diff --git a/rocclr/runtime/device/gpu/gslbe/src/rt/backend.h b/rocclr/runtime/device/gpu/gslbe/src/rt/backend.h
index 902763626d..edda5fcb8f 100644
--- a/rocclr/runtime/device/gpu/gslbe/src/rt/backend.h
+++ b/rocclr/runtime/device/gpu/gslbe/src/rt/backend.h
@@ -1,13 +1,245 @@
#ifndef __BACKEND_H__
#define __BACKEND_H__
-#include "cal.h"
-#include "calcl.h"
-
-//internal
#include
#include
+//internal
+#include "gsl_enum.h"
+#include "gsl_types.h"
+#include "cm_enum.h"
+#include "caltarget.h"
+
+typedef void CALvoid; /**< void type */
+typedef char CALchar; /**< ASCII character */
+typedef signed char CALbyte; /**< 1 byte signed integer value */
+typedef unsigned char CALubyte; /**< 1 byte unsigned integer value */
+typedef signed short CALshort; /**< 2 byte signed integer value */
+typedef unsigned short CALushort; /**< 2 byte unsigned integer value */
+typedef signed int CALint; /**< 4 byte signed integer value */
+typedef unsigned int CALuint; /**< 4 byte unsigned intger value */
+typedef float CALfloat; /**< 32-bit IEEE floating point value */
+typedef double CALdouble; /**< 64-bit IEEE floating point value */
+typedef signed long CALlong; /**< long value */
+typedef unsigned long CALulong; /**< unsigned long value */
+
+#if defined(_MSC_VER)
+
+typedef signed __int64 CALint64; /**< 8 byte signed integer value */
+typedef unsigned __int64 CALuint64; /**< 8 byte unsigned integer value */
+
+#elif defined(__GNUC__)
+
+typedef signed long long CALint64; /**< 8 byte signed integer value */
+typedef unsigned long long CALuint64; /**< 8 byte unsigned integer value */
+
+#else
+#error "Unsupported compiler type."
+#endif
+
+/** Boolean type */
+typedef enum CALbooleanEnum {
+ CAL_FALSE = 0, /**< Boolean false value */
+ CAL_TRUE = 1 /**< Boolean true value */
+} CALboolean;
+
+/** CAL image container */
+typedef struct CALimageRec* CALimage;
+
+#define CAL_ASIC_INFO_MAX_LEN 128
+
+/** CAL computational domain */
+typedef struct CALdomainRec {
+ CALuint x; /**< x origin of domain */
+ CALuint y; /**< y origin of domain */
+ CALuint width; /**< width of domain */
+ CALuint height; /**< height of domain */
+} CALdomain;
+
+/** CAL device attributes */
+typedef struct CALdeviceattribsRec {
+ CALuint struct_size; /**< Client filled out size of CALdeviceattribs struct */
+ CALtarget target; /**< Asic identifier */
+ CALuint localRAM; /**< Amount of local GPU RAM in megabytes */
+ CALuint uncachedRemoteRAM; /**< Amount of uncached remote GPU memory in megabytes */
+ CALuint cachedRemoteRAM; /**< Amount of cached remote GPU memory in megabytes */
+ CALuint engineClock; /**< GPU device clock rate in megahertz */
+ CALuint memoryClock; /**< GPU memory clock rate in megahertz */
+ CALuint wavefrontSize; /**< Wavefront size */
+ CALuint numberOfSIMD; /**< Number of SIMDs */
+ CALuint numberOfCUsperShaderArray; /**< Number of CUs per shader array */
+ bool doublePrecision; /**< double precision supported */
+ bool localDataShare; /**< local data share supported */
+ bool globalDataShare; /**< global data share supported */
+ bool globalGPR; /**< global GPR supported */
+ bool computeShader; /**< compute shader supported */
+ bool memExport; /**< memexport supported */
+ CALuint pitch_alignment; /**< Required alignment for calCreateRes allocations (in data elements) */
+ CALuint surface_alignment; /**< Required start address alignment for calCreateRes allocations (in bytes) */
+ CALuint numberOfUAVs; /**< Number of UAVs */
+ bool bUAVMemExport; /**< Hw only supports mem export to simulate 1 UAV */
+ CALuint numberOfShaderEngines; /**< Number of shader engines */
+ CALuint targetRevision; /**< Asic family revision */
+ CALuint totalVisibleHeap; /**< Amount of visible local GPU RAM in megabytes */
+ CALuint totalInvisibleHeap; /**< Amount of invisible local GPU RAM in megabytes */
+ CALuint totalDirectHeap; /**< Amount of direct GPU memory in megabytes */
+ CALuint totalCoherentHeap; /**< Amount of coherent GPU memory in megabytes */
+ CALuint totalRemoteSharedHeap; /**< Amount of remote Shared GPU memory in megabytes */
+ CALuint totalCachedRemoteSharedHeap; /**< Amount of cached remote Shared GPU memory in megabytes */
+ CALuint totalSDIHeap; /**< Amount of SDI memory allocated in CCC */
+ CALuint pciTopologyInformation; /**< PCI topology information contains: bus, device and function number. */
+ CALchar boardName[CAL_ASIC_INFO_MAX_LEN]; /**< Actual ASIC board name and not the internal name. */
+ bool vectorBufferInstructionAddr64; /**< Vector buffer instructions support ADDR64 mode */
+ bool memRandomAccessTargetInstructions; /**< hw/sc supports memory RAT (Random Access Target) instructions e.g. mem0.x_z_ supported */
+ CALuint memBusWidth; /**< Memory busw width */
+ CALuint numMemBanks; /**< Number of memory banks */
+ CALuint counterFreq; /**< Ref clock counter frequency */
+ double nanoSecondsPerTick; /**< Nano seconds per GPU tick */
+ bool longIdleDetect; /**< Whether LongIdleDetect enabled */
+ bool svmAtomics; /**< check if svm atomics support */
+ CALuint64 vaStart; /**< VA start address */
+ CALuint64 vaEnd; /**< VA end address */
+ bool isWorkstation; /**< Whether Device is a Workstation/Server part */
+ CALuint numOfVpu; /**< number of vpu in the device*/
+ bool isOpenCL200Device; /**< the flag to mark if the device is OpenCL 200 */
+ bool isSVMFineGrainSystem; /**< check if SVM finegrainsystem */
+} CALdeviceattribs;
+
+/** CAL device status */
+typedef struct CALdevicestatusRec {
+ CALuint struct_size; /**< Client filled out size of CALdevicestatus struct */
+ CALuint availLocalRAM; /**< Amount of available local GPU RAM in megabytes */
+ CALuint availUncachedRemoteRAM; /**< Amount of available uncached remote GPU memory in megabytes */
+ CALuint availCachedRemoteRAM; /**< Amount of available cached remote GPU memory in megabytes */
+ CALuint availVisibleHeap; /**< Amount of available visible local GPU RAM in megabytes */
+ CALuint availInvisibleHeap; /**< Amount of available invisible local GPU RAM in megabytes */
+ CALuint availDirectHeap; /**< Amount of available direct GPU memory in megabytes */
+ CALuint availCoherentHeap; /**< Amount of available coherent GPU memory in megabytes */
+ CALuint availRemoteSharedHeap; /**< Amount of available remote Shared GPU memory in megabytes */
+ CALuint availCachedRemoteSharedHeap; /**< Amount of available cached remote Shared GPU memory in megabytes */
+ CALuint largestBlockVisibleHeap; /**< Largest block available visible local GPU RAM in megabytes */
+ CALuint largestBlockInvisibleHeap; /**< Largest block available invisible local GPU RAM in megabytes */
+ CALuint largestBlockRemoteHeap; /**< Largest block available remote GPU memory in megabytes */
+ CALuint largestBlockCachedRemoteHeap; /**< Largest block available cached remote GPU memory in megabytes */
+ CALuint largestBlockDirectHeap; /**< Largest block available direct GPU memory in megabytes */
+ CALuint largestBlockCoherentHeap; /**< Largest block available coherent GPU memory in megabytes */
+ CALuint largestBlockRemoteSharedHeap; /**< Largest block available remote Shared GPU memory in megabytes */
+ CALuint largestBlockCachedRemoteSharedHeap; /**< Largest block available cached remote Shared GPU memory in megabytes */
+} CALdevicestatus;
+
+/** CAL resource allocation flags **/
+typedef enum CALresallocflagsEnum {
+ CAL_RESALLOC_GLOBAL_BUFFER = 1, /**< used for global import/export buffer */
+} CALresallocflags;
+
+
+/** CAL function information **/
+typedef struct CALfuncInfoRec
+{
+ CALuint maxScratchRegsNeeded; /**< Maximum number of scratch regs needed */
+ CALuint numSharedGPRUser; /**< Number of shared GPRs */
+ CALuint numSharedGPRTotal; /**< Number of shared GPRs including ones used by SC */
+ bool eCsSetupMode; /**< Slow mode */
+ CALuint numThreadPerGroup; /**< Flattend umber of threads per group */
+ CALuint numThreadPerGroupX; /**< x dimension of numThreadPerGroup */
+ CALuint numThreadPerGroupY; /**< y dimension of numThreadPerGroup */
+ CALuint numThreadPerGroupZ; /**< z dimension of numThreadPerGroup */
+ CALuint totalNumThreadGroup; /**< Total number of thread groups */
+ CALuint numWavefrontPerSIMD; /**< Number of wavefronts per SIMD */
+ bool isMaxNumWavePerSIMD; /**< Is this the max num active wavefronts per SIMD */
+ bool setBufferForNumGroup; /**< Need to set up buffer for info on number of thread groups? */
+ CALuint wavefrontSize; /**< number of threads per wavefront. */
+ CALuint numGPRsAvailable; /**< number of GPRs available to the program */
+ CALuint numGPRsUsed; /**< number of GPRs used by the program */
+ CALuint LDSSizeAvailable; /**< LDS size available to the program */
+ CALuint LDSSizeUsed; /**< LDS size used by the program */
+ CALuint stackSizeAvailable; /**< stack size availabe to the program */
+ CALuint stackSizeUsed; /**< stack size use by the program */
+ CALuint numSGPRsAvailable; /**< number of SGPRs available to the program */
+ CALuint numSGPRsUsed; /**< number of SGPRs used by the program */
+ CALuint numVGPRsAvailable; /**< number of VGPRs available to the program */
+ CALuint numVGPRsUsed; /**< number of VGPRs used by the program */
+} CALfuncInfo;
+
+typedef struct ProgramGridRec
+{
+ gslDomain3D gridBlock; /**< size of a block of data */
+ gslDomain3D gridSize; /**< size of 'blocks' to execute. */
+ gslDomain3D partialGridBlock;/** Partial grid block */
+ CALuint localSize; /** size of OpenCL Local Memory in bytes */
+} ProgramGrid;
+
+// flags for calCtxWaitForEvents
+typedef enum CALwaitTypeEnum
+{
+ CAL_WAIT_POLLING = 0,
+ CAL_WAIT_LOW_CPU_UTILIZATION = 1,
+} CALwaitType;
+
+//
+// calResAllocView typedefs
+//
+typedef enum CALresallocviewflagsRec {
+ CAL_RESALLOCVIEW_GLOBAL_BUFFER = CAL_RESALLOC_GLOBAL_BUFFER, /**< used for global import/export buffer */
+ CAL_RESALLOCVIEW_LINEAR_ALIGNED = CAL_RESALLOC_GLOBAL_BUFFER, /**< 256 byte alignment restriction. */
+ CAL_RESALLOCVIEW_LINEAR_UNALIGNED = 3, /**< no alignment restrictions */
+} CALresallocviewflags;
+
+typedef struct CALresourceDescRec {
+ gslMemObjectAttribLocation type;
+ gslResource3D size;
+ cmSurfFmt format;
+ gslChannelOrder channelOrder;
+ gslMemObjectAttribType dimension;
+ CALuint mipLevels;
+ CALvoid* systemMemory;
+ CALuint flags;
+ CALuint systemMemorySize;
+ CALuint64 busAddress[2];
+ mcaddr vaBase;
+ gslMemObjectAttribSection section;
+ CALuint minAlignment;
+ bool isAllocExecute;
+} CALresourceDesc;
+
+typedef enum CALresallocsliceviewflagsRec {
+ CAL_RESALLOCSLICEVIEW_GLOBAL_BUFFER = CAL_RESALLOC_GLOBAL_BUFFER, /**< used for global import/export buffer */
+ CAL_RESALLOCSLICEVIEW_LINEAR_ALIGNED = CAL_RESALLOC_GLOBAL_BUFFER, /**< 256 byte alignment restriction. */
+ CAL_RESALLOCSLICEVIEW_LINEAR_UNALIGNED = CAL_RESALLOCVIEW_LINEAR_UNALIGNED, /**< no alignment restrictions */
+ CAL_RESALLOCSLICEVIEW_LEVEL = 0x10, /**< sliceDesc.layer is not used, the whole level is only*/
+ CAL_RESALLOCSLICEVIEW_LAYER = 0x20, /**< sliceDesc.layer is not used, the whole level is only*/
+ CAL_RESALLOCSLICEVIEW_LEVEL_AND_LAYER = CAL_RESALLOCSLICEVIEW_LEVEL | CAL_RESALLOCSLICEVIEW_LAYER,
+} CALresallocsliceviewflags;
+
+//
+// Thread Trace Extension
+//
+
+typedef struct CALthreadTraceConfigRec CALthreadTraceConfig;
+
+struct CALthreadTraceConfigRec
+{
+ CALuint cu; // target compute unit [cu]
+ CALuint sh; // target shader array [sh],that contains target cu
+ CALuint simd_mask; // bitmask to enable or disable target tokens for different SIMDs
+ CALuint vm_id_mask; // virtual memory [vm] IDs to capture
+ CALuint token_mask; // bitmask indicating which trace token IDs will be included in the trace
+ CALuint reg_mask; // bitmask indicating which register types should be included in the trace
+ CALuint inst_mask; // types of instruction scheduling updates which should be recorded
+ CALuint random_seed; // linear feedback shift register [LFSR] seed
+ CALuint user_data; // user data ,which is written as payload
+ CALuint capture_mode; // indicator for the way how THREAD_TRACE_START / STOP events affect token collection
+ CALboolean is_user_data; // indicator if user_data is set
+ CALboolean is_wrapped; // indicator if the memory buffer should be wrapped around instead of stopping at the end
+};
+
+typedef enum CALmemcopyflagsEnum
+{
+ CAL_MEMCOPY_DEFAULT = 0, /**< default CAL behavior of partial sync */
+ CAL_MEMCOPY_SYNC = 1, /**< used to synchronize with the specified CAL context */
+ CAL_MEMCOPY_ASYNC = 2, /**< used to indicate completely asynchronous behavior */
+} CALmemcopyflags;
+
class CALGSLDevice;
//! Engine types
@@ -35,14 +267,6 @@ struct GpuEvent
void invalidate() { id = InvalidID; }
};
-typedef enum CALBEtilingEnum
-{
- CALBE_TILING_DEFAULT,
- CALBE_TILING_LINEAR,
- CALBE_TILING_TILED,
- CALBEtiling_FIRST = CALBE_TILING_DEFAULT,
- CALBEtiling_LAST = CALBE_TILING_TILED,
-} CALBEtiling;
/*
* GPU Backend functions
diff --git a/rocclr/runtime/device/gpu/gslbe/src/rt/caltarget.h b/rocclr/runtime/device/gpu/gslbe/src/rt/caltarget.h
new file mode 100644
index 0000000000..118e9323ef
--- /dev/null
+++ b/rocclr/runtime/device/gpu/gslbe/src/rt/caltarget.h
@@ -0,0 +1,51 @@
+#ifndef __CALTARGET_H__
+#define __CALTARGET_H__
+
+/** Device Kernel ISA */
+typedef enum CALtargetEnum {
+ CAL_TARGET_600, /**< R600 GPU ISA */
+ CAL_TARGET_610, /**< RV610 GPU ISA */
+ CAL_TARGET_630, /**< RV630 GPU ISA */
+ CAL_TARGET_670, /**< RV670 GPU ISA */
+ CAL_TARGET_7XX, /**< R700 class GPU ISA */
+ CAL_TARGET_770, /**< RV770 GPU ISA */
+ CAL_TARGET_710, /**< RV710 GPU ISA */
+ CAL_TARGET_730, /**< RV730 GPU ISA */
+ CAL_TARGET_CYPRESS, /**< CYPRESS GPU ISA */
+ CAL_TARGET_JUNIPER, /**< JUNIPER GPU ISA */
+ CAL_TARGET_REDWOOD, /**< REDWOOD GPU ISA */
+ CAL_TARGET_CEDAR, /**< CEDAR GPU ISA */
+//##BEGIN_PRIVATE##
+ CAL_TARGET_SUMO, /**< SUMO GPU ISA */
+ CAL_TARGET_SUPERSUMO, /**< SUPERSUMO GPU ISA */
+ CAL_TARGET_WRESTLER, /**< WRESTLER GPU ISA */
+ CAL_TARGET_CAYMAN, /**< CAYMAN GPU ISA */
+ CAL_TARGET_KAUAI, /**< KAUAI GPU ISA */
+ CAL_TARGET_BARTS , /**< BARTS GPU ISA */
+ CAL_TARGET_TURKS , /**< TURKS GPU ISA */
+ CAL_TARGET_CAICOS, /**< CAICOS GPU ISA */
+ CAL_TARGET_TAHITI, /**< TAHITI GPU ISA*/
+ CAL_TARGET_PITCAIRN, /**< PITCAIRN GPU ISA*/
+ CAL_TARGET_CAPEVERDE, /**< CAPE VERDE GPU ISA*/
+ CAL_TARGET_DEVASTATOR, /**< DEVASTATOR GPU ISA*/
+ CAL_TARGET_SCRAPPER, /**< SCRAPPER GPU ISA*/
+ CAL_TARGET_OLAND, /**< OLAND GPU ISA*/
+ CAL_TARGET_BONAIRE, /**< BONAIRE GPU ISA*/
+ CAL_TARGET_SPECTRE, /**< KAVERI1 GPU ISA*/
+ CAL_TARGET_SPOOKY, /**< KAVERI2 GPU ISA*/
+ CAL_TARGET_KALINDI, /**< KALINDI GPU ISA*/
+ CAL_TARGET_HAINAN, /**< HAINAN GPU ISA*/
+ CAL_TARGET_HAWAII, /**< HAWAII GPU ISA*/
+ CAL_TARGET_ICELAND, /**< ICELAND GPU ISA*/
+ CAL_TARGET_TONGA, /**< TONGA GPU ISA*/
+ CAL_TARGET_GODAVARI, /**< MULLINS GPU ISA*/
+ CAL_TARGET_FIJI, /**< FIJI GPU ISA*/
+ CAL_TARGET_CARRIZO, /**< CARRIZO GPU ISA*/
+ CAL_TARGET_ELLESMERE, /**< ELLESMERE GPU ISA*/
+ CAL_TARGET_BAFFIN, /**< BAFFIN GPU ISA*/
+ CAL_TARGET_GREENLAND, /**< GREENLAND GPU ISA*/
+ CAL_TARGET_LAST = CAL_TARGET_GREENLAND, /**< last */
+//##END_PRIVATE##
+} CALtarget;
+
+#endif
diff --git a/rocclr/runtime/device/gpu/gslbe/src/rt/inifile/inifile.cpp b/rocclr/runtime/device/gpu/gslbe/src/rt/inifile/inifile.cpp
index aff6c0f1a7..42bcdede7b 100644
--- a/rocclr/runtime/device/gpu/gslbe/src/rt/inifile/inifile.cpp
+++ b/rocclr/runtime/device/gpu/gslbe/src/rt/inifile/inifile.cpp
@@ -14,7 +14,6 @@
#include "inifile.h"
#include "cm_string.h"
#include "inifile_parser.h"
-#include "cal.h"
#include "assert.h"
#include
diff --git a/rocclr/runtime/device/gpu/gslbe/src/rt/inifile/inifile.h b/rocclr/runtime/device/gpu/gslbe/src/rt/inifile/inifile.h
index d1dafb54e2..679f7137ed 100644
--- a/rocclr/runtime/device/gpu/gslbe/src/rt/inifile/inifile.h
+++ b/rocclr/runtime/device/gpu/gslbe/src/rt/inifile/inifile.h
@@ -14,7 +14,7 @@
/// @brief INI File Parser
#include "cm_string.h"
-#include "cal.h"
+#include "backend.h"
#include