shader.cc (12748:ae5ce8e42de7) | shader.cc (12749:223c83ed9979) |
---|---|
1/* 2 * Copyright (c) 2011-2015 Advanced Micro Devices, Inc. 3 * All rights reserved. 4 * 5 * For use for simulation and test purposes only 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions are met: --- 212 unchanged lines hidden (view full) --- 221 222void 223Shader::handshake(GpuDispatcher *_dispatcher) 224{ 225 dispatcher = _dispatcher; 226} 227 228void | 1/* 2 * Copyright (c) 2011-2015 Advanced Micro Devices, Inc. 3 * All rights reserved. 4 * 5 * For use for simulation and test purposes only 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions are met: --- 212 unchanged lines hidden (view full) --- 221 222void 223Shader::handshake(GpuDispatcher *_dispatcher) 224{ 225 dispatcher = _dispatcher; 226} 227 228void |
229Shader::doFunctionalAccess(RequestPtr req, MemCmd cmd, void *data, | 229Shader::doFunctionalAccess(const RequestPtr &req, MemCmd cmd, void *data, |
230 bool suppress_func_errors, int cu_id) 231{ 232 int block_size = cuList.at(cu_id)->cacheLineSize(); 233 unsigned size = req->getSize(); 234 235 Addr tmp_addr; 236 BaseTLB::Mode trans_mode; 237 --- 95 unchanged lines hidden (view full) --- 333void 334Shader::AccessMem(uint64_t address, void *ptr, uint32_t size, int cu_id, 335 MemCmd cmd, bool suppress_func_errors) 336{ 337 uint8_t *data_buf = (uint8_t*)ptr; 338 339 for (ChunkGenerator gen(address, size, cuList.at(cu_id)->cacheLineSize()); 340 !gen.done(); gen.next()) { | 230 bool suppress_func_errors, int cu_id) 231{ 232 int block_size = cuList.at(cu_id)->cacheLineSize(); 233 unsigned size = req->getSize(); 234 235 Addr tmp_addr; 236 BaseTLB::Mode trans_mode; 237 --- 95 unchanged lines hidden (view full) --- 333void 334Shader::AccessMem(uint64_t address, void *ptr, uint32_t size, int cu_id, 335 MemCmd cmd, bool suppress_func_errors) 336{ 337 uint8_t *data_buf = (uint8_t*)ptr; 338 339 for (ChunkGenerator gen(address, size, cuList.at(cu_id)->cacheLineSize()); 340 !gen.done(); gen.next()) { |
341 RequestPtr req = new Request(0, gen.addr(), gen.size(), 0, 342 cuList[0]->masterId(), 0, 0, 0); | |
343 | 341 |
342 RequestPtr req = std::make_shared<Request>( 343 0, gen.addr(), gen.size(), 0, 344 cuList[0]->masterId(), 0, 0, nullptr); 345 |
|
344 doFunctionalAccess(req, cmd, data_buf, suppress_func_errors, cu_id); 345 data_buf += gen.size(); | 346 doFunctionalAccess(req, cmd, data_buf, suppress_func_errors, cu_id); 347 data_buf += gen.size(); |
346 delete req; | |
347 } 348} 349 350void 351Shader::ReadMem(uint64_t address, void *ptr, uint32_t size, int cu_id) 352{ 353 AccessMem(address, ptr, size, cu_id, MemCmd::ReadReq, false); 354} --- 51 unchanged lines hidden --- | 348 } 349} 350 351void 352Shader::ReadMem(uint64_t address, void *ptr, uint32_t size, int cu_id) 353{ 354 AccessMem(address, ptr, size, cu_id, MemCmd::ReadReq, false); 355} --- 51 unchanged lines hidden --- |