Changeset 2749 in CLRX


Ignore:
Timestamp:
Jan 22, 2017, 7:18:34 AM (2 years ago)
Author:
matszpk
Message:

CLRadeonExtender: Add '.gdssize' to AmdCL2 format handling (original patch from zawawawa from github).

Location:
CLRadeonExtender/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • CLRadeonExtender/trunk/CLRX/amdbin/AmdCL2BinGen.h

    r2682 r2749  
    6868    uint32_t priority;  ///< priority
    6969    size_t localSize; ///< used local size (not local defined in kernel arguments)
     70    uint32_t gdsSize; ///< GDS size
    7071    uint32_t scratchBufferSize; ///< size of scratch buffer
    7172    bool ieeeMode;  ///< IEEE mode
  • CLRadeonExtender/trunk/CONTRIBUTORS

    r2423 r2749  
    11Mihai Preda - mispelling in GcnTimings
     2zawawawa from github - add '.gdssize' pseudo-op to AsmAmdCL2
  • CLRadeonExtender/trunk/amdasm/AsmAmdCL2Format.cpp

    r2721 r2749  
    3838    "arg", "bssdata", "compile_options", "config",
    3939    "cws", "debugmode", "dims", "driver_version", "dx10clamp", "exceptions",
    40     "floatmode", "get_driver_version", "globaldata", "ieeemode", "inner",
     40    "floatmode", "gdssize", "get_driver_version",
     41    "globaldata", "ieeemode", "inner",
    4142    "isametadata", "localsize", "metadata", "pgmrsrc1", "pgmrsrc2",
    4243    "priority", "privmode", "rwdata", "sampler",
     
    5253    AMDCL2OP_CONFIG, AMDCL2OP_CWS, AMDCL2OP_DEBUGMODE, AMDCL2OP_DIMS,
    5354    AMDCL2OP_DRIVER_VERSION, AMDCL2OP_DX10CLAMP, AMDCL2OP_EXCEPTIONS,
    54     AMDCL2OP_FLOATMODE, AMDCL2OP_GET_DRIVER_VERSION, AMDCL2OP_GLOBALDATA,
     55    AMDCL2OP_FLOATMODE, AMDCL2OP_GDSSIZE, AMDCL2OP_GET_DRIVER_VERSION, AMDCL2OP_GLOBALDATA,
    5556    AMDCL2OP_IEEEMODE, AMDCL2OP_INNER, AMDCL2OP_ISAMETADATA, AMDCL2OP_LOCALSIZE,
    5657    AMDCL2OP_METADATA, AMDCL2OP_PGMRSRC1, AMDCL2OP_PGMRSRC2, AMDCL2OP_PRIORITY,
     
    779780                break;
    780781            }
     782            case AMDCL2CVAL_GDSSIZE:
     783            {
     784                if (value > 32768)
     785                {
     786                    char buf[64];
     787                    snprintf(buf, 64, "GDSSize out of range (0-%u)", 32768);
     788                    asmr.printError(valuePlace, buf);
     789                    good = false;
     790                }
     791                break;
     792            }
    781793            case AMDCL2CVAL_PGMRSRC1:
    782794            case AMDCL2CVAL_PGMRSRC2:
     
    813825        case AMDCL2CVAL_LOCALSIZE:
    814826            config.localSize = value;
     827            break;
     828        case AMDCL2CVAL_GDSSIZE:
     829            config.gdsSize = value;
    815830            break;
    816831        case AMDCL2CVAL_SCRATCHBUFFER:
     
    12471262            AsmAmdCL2PseudoOps::setConfigValue(*this, stmtPlace, linePtr,
    12481263                       AMDCL2CVAL_FLOATMODE);
     1264            break;
     1265        case AMDCL2OP_GDSSIZE:
     1266            AsmAmdCL2PseudoOps::setConfigValue(*this, stmtPlace, linePtr,
     1267                       AMDCL2CVAL_GDSSIZE);
    12491268            break;
    12501269        case AMDCL2OP_GET_DRIVER_VERSION:
  • CLRadeonExtender/trunk/amdasm/AsmInternals.h

    r2747 r2749  
    452452    AMDCL2CVAL_FLOATMODE,
    453453    AMDCL2CVAL_LOCALSIZE,
     454    AMDCL2CVAL_GDSSIZE,
    454455    AMDCL2CVAL_SCRATCHBUFFER,
    455456    AMDCL2CVAL_PRIORITY,
  • CLRadeonExtender/trunk/amdasm/DisasmAmdCL2.cpp

    r2708 r2749  
    291291    uint32_t scratchBufferSize;
    292292    uint32_t localSize; // in bytes
    293     uint32_t zero1;
     293    uint32_t gdsSize;   // in bytes
    294294    uint32_t kernelArgsSize;
    295295    uint32_t zeroes[2];
     
    386386    config.scratchBufferSize = ULEV(setupData->scratchBufferSize);
    387387    config.localSize = ULEV(setupData->localSize);
     388    config.gdsSize = ULEV(setupData->gdsSize);
    388389    uint16_t ksetup1 = ULEV(setupData->setup1);
    389390    config.useSetup = (ksetup1&2)!=0;
     
    652653        output.write(buf, bufSize);
    653654    }
     655    if (config.gdsSize!=0)
     656    {
     657        bufSize = snprintf(buf, 100, "        .gdssize %llu\n",
     658                       cxullong(config.gdsSize));
     659        output.write(buf, bufSize);
     660    }
    654661    bufSize = snprintf(buf, 100, "        .floatmode 0x%02x\n", config.floatMode);
    655662    output.write(buf, bufSize);
  • CLRadeonExtender/trunk/amdbin/AmdCL2BinGen.cpp

    r2705 r2749  
    10221022    uint32_t scratchBufferSize;
    10231023    uint32_t localSize; // in bytes
    1024     uint32_t zero1;
     1024    uint32_t gdsSize;
    10251025    uint32_t kernelArgsSize;
    10261026    uint32_t zeroes[2];
     
    11021102    SLEV(setupData.scratchBufferSize, config.scratchBufferSize);
    11031103    SLEV(setupData.localSize, config.localSize);
    1104     setupData.zero1 = 0;
     1104    SLEV(setupData.gdsSize, config.gdsSize);
    11051105    setupData.zeroes[0] = setupData.zeroes[1] = 0;
    11061106    setupData.zero3 = 0;
Note: See TracChangeset for help on using the changeset viewer.