|
|
|
@ -12,13 +12,12 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License. */
|
|
|
|
limitations under the License. */
|
|
|
|
|
|
|
|
|
|
|
|
#include "paddle/fluid/inference/tensorrt/engine.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <cuda.h>
|
|
|
|
#include <cuda.h>
|
|
|
|
#include <cuda_runtime_api.h>
|
|
|
|
#include <cuda_runtime_api.h>
|
|
|
|
#include <glog/logging.h>
|
|
|
|
#include <glog/logging.h>
|
|
|
|
#include <gtest/gtest.h>
|
|
|
|
#include <gtest/gtest.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "paddle/fluid/inference/tensorrt/engine.h"
|
|
|
|
#include "paddle/fluid/platform/enforce.h"
|
|
|
|
#include "paddle/fluid/platform/enforce.h"
|
|
|
|
|
|
|
|
|
|
|
|
namespace paddle {
|
|
|
|
namespace paddle {
|
|
|
|
@ -65,7 +64,8 @@ TEST_F(TensorRTEngineTest, add_layer) {
|
|
|
|
|
|
|
|
|
|
|
|
// fill in real data
|
|
|
|
// fill in real data
|
|
|
|
float x_v = 1234;
|
|
|
|
float x_v = 1234;
|
|
|
|
engine_->SetInputFromCPU("x", (void*)&x_v, 1 * sizeof(float));
|
|
|
|
engine_->SetInputFromCPU("x", reinterpret_cast<void*>(&x_v),
|
|
|
|
|
|
|
|
1 * sizeof(float));
|
|
|
|
LOG(INFO) << "to execute";
|
|
|
|
LOG(INFO) << "to execute";
|
|
|
|
engine_->Execute(1);
|
|
|
|
engine_->Execute(1);
|
|
|
|
|
|
|
|
|
|
|
|
|