     const char* op,
     IndexType totalElements,
     dim3 grid, dim3 block,
-    int A)
+    int A,
+    cudaStream_t stream)
 {
   // using c++11 std::is_same here
   const char* type;

                                  THCudaTensor* b,
                                  THCudaTensor* c,
                                  const char* apply_header,
                                  const char* op_string) {
  TensorArgType aType = ReadWrite;
  TensorArgType bType = ReadWrite;
  TensorArgType cType = ReadWrite;

  long totalElements = THCudaTensor_nElement(state, a);


    // compilation time.
    if (aInfo.isContiguous() && bInfo.isContiguous()) {
      THCudaTensor_pointwiseApply2RTC(aInfo, bInfo, apply_header, op_string,
	  			(unsigned long)totalElements, grid, block, -2, -2, stream);
    } else {
      THCudaTensor_pointwiseApply2RTC(aInfo, bInfo, apply_header, op_string,
	  			(unsigned long)totalElements, grid, block, -1, -1, stream);
    }
  }
#undef HANDLE_CASE
