I believe dtype=float would initialize the tensor with torch.float64, so you might want to use dtype=torch.float32.
Also, I’m unsure about the usage of the .data_ptr() method in Python, so I would pass a torch::Tensor to the C++ method and forward A.data_ptr<float>() to the CUDA kernel.