fd_array.cc (12334:e0ab29a34764) | fd_array.cc (12392:e0dbdf30a2a5) |
---|---|
1/* 2 * Copyright (c) 2016 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: --- 117 unchanged lines hidden (view full) --- 126{ 127 /** 128 * Use this lambda to highlight what we mean to do with the seek. 129 * Notice that this either seeks correctly (sets the file location on the 130 * host) or it fails with a fatal. The error is fatal because it's not 131 * possible to guarantee that the simulation will proceed as it should 132 * have in the same way that it would have proceeded sans checkpoints. 133 */ | 1/* 2 * Copyright (c) 2016 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: --- 117 unchanged lines hidden (view full) --- 126{ 127 /** 128 * Use this lambda to highlight what we mean to do with the seek. 129 * Notice that this either seeks correctly (sets the file location on the 130 * host) or it fails with a fatal. The error is fatal because it's not 131 * possible to guarantee that the simulation will proceed as it should 132 * have in the same way that it would have proceeded sans checkpoints. 133 */ |
134 void (*seek)(std::shared_ptr<FileFDEntry>) 135 = [] (std::shared_ptr<FileFDEntry> ffd) | 134 auto seek = [] (std::shared_ptr<FileFDEntry> ffd) |
136 { 137 if (lseek(ffd->getSimFD(), ffd->getFileOffset(), SEEK_SET) < 0) 138 fatal("Unable to seek to location in %s", ffd->getFileName()); 139 }; 140 141 std::map<std::string, int>::iterator it; 142 143 /** --- 208 unchanged lines hidden --- | 135 { 136 if (lseek(ffd->getSimFD(), ffd->getFileOffset(), SEEK_SET) < 0) 137 fatal("Unable to seek to location in %s", ffd->getFileName()); 138 }; 139 140 std::map<std::string, int>::iterator it; 141 142 /** --- 208 unchanged lines hidden --- |