   // dimension, and the loop to translate the linear index to the array
   // index can be similarly collapsed. That is what this unrolling is for.
 #define HANDLE_CASE(TYPE, A, B)                                \
-  THCudaTensor_pointwiseApply2RTC(aInfo, bInfo, apply_header, op_string, (TYPE)totalElements, grid, block, A, B);
+  THCudaTensor_pointwiseApply2RTC(aInfo, bInfo, apply_header, op_string, (TYPE)totalElements, grid, block, A, B, stream);
 
 #define HANDLE_B_CASE(TYPE, A, B)                   \
   {                                                 \

    if (aInfo.isContiguous() && bInfo.isContiguous() && cInfo.isContiguous()) {
      THCudaTensor_pointwiseApply3RTC(aInfo, bInfo, cInfo,
	  		apply_header, op_string,
	  		(unsigned long)totalElements, grid, block, -2, -2, -2);
    } else {
      THCudaTensor_pointwiseApply3RTC(aInfo, bInfo, cInfo,
	  		apply_header, op_string,
	  		(unsigned long)totalElements, grid, block, -1, -1, -1);
    }
  }
#undef HANDLE_CASE

#define HANDLE_CASE(TYPE, A, B, C)                                      \
  THCudaTensor_pointwiseApply3RTC(aInfo, bInfo, cInfo,			\
      apply_header, op_string, (TYPE)totalElements, grid, block,	\
      A, B, C, stream);								\

#define HANDLE_C_CASE(TYPE, A, B, C)             \
  {                                              \
