From 62df0352e174f81892a321e72fd66f7d0015a60f Mon Sep 17 00:00:00 2001
From: Ruta Gadkari <rgadkari@nvidia.com>
Date: Sun, 17 Feb 2019 18:23:35 +0530
Subject: [PATCH 1/1] compat/cuda: Fix CUdeviceptr definition for 64bit CPU
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

NVIDIA driver implementation defines and expects ‘CUdeviceptr’ to
be 64-bit wide on the 64-bit platforms.
FFMPEG build on PPC64 architecture on the other hand, falls back to
an incorrect (32-bit wide data type) definition of this data type.
This patch adds a new build time check to pick up the correct definition
on PPC64 architecture.
---
 include/ffnvcodec/dynlink_cuda.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/ffnvcodec/dynlink_cuda.h b/include/ffnvcodec/dynlink_cuda.h
index 779be1f..0baf953 100644
--- a/include/ffnvcodec/dynlink_cuda.h
+++ b/include/ffnvcodec/dynlink_cuda.h
@@ -52,7 +52,7 @@ typedef void* CUmipmappedArray;
 typedef void* CUgraphicsResource;
 typedef void* CUexternalMemory;
 typedef void* CUexternalSemaphore;
-#if defined(__x86_64) || defined(AMD64) || defined(_M_AMD64)
+#if defined(__x86_64) || defined(AMD64) || defined(_M_AMD64) || defined(__LP64__)
 typedef unsigned long long CUdeviceptr;
 #else
 typedef unsigned int CUdeviceptr;
-- 
2.7.4

