.data_ptr() is fine, just passing it to ctypes as an int is not a good idea. Wrap in ctypes.c_void_p, and fix the dtype to float.
I might add that it’s always a good idea to print the stuff you’re passing across the Python-C interface, discovering the mismatch between the Python pointer and the (only arriving as 32 bit) pointer on the C side might have saved you that bit of confusion.