Fix check_kernel_launches.py for macros and provide extended context (#49365)
Summary:
`check_kernel_launches.py` currently gives a false positive in instances such as:
```
735: <<<smallIndexGrid, smallIndexBlock, 0, stream>>>( \
736: outInfo, selfInfo, indicesInfo, \
737: outSelectDim, selfSelectDim, static_cast<TYPE>(sliceSize), \
738: selfSelectDimSize); \
739: C10_CUDA_KERNEL_LAUNCH_CHECK();
```
because the newlines after the last `\` are not consumed by the regex. This fixes that.
In addition, the regex is modified to provide greater context for the start of the kernel launch. This changes the context from:
```
157: (
158: size, X_strides, Y_dims, X, Y);
```
to
```
157: <<<M, CAFFE_CUDA_NUM_THREADS, 0, context->cuda_stream()>>>(
158: size, X_strides, Y_dims, X, Y);
```
Pull Request resolved: https://github.com/pytorch/pytorch/pull/49365
Test Plan:
```
buck test //caffe2/test:kernel_launch_checks -- --print-passing-details
```
Reviewed By: aakshintala
Differential Revision: D25545402
Pulled By: r-barnes
fbshipit-source-id: 76feac6a002187239853752b892f4517722a77bf